WP Manifestindependent plugin directory
manifest / developer / mihdan-php-ref

Mihdan: PHP REF

WordPress plugin: a better alternative to print_r / var_dump

★ 2stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/mihdan/mihdan-php-ref/archive/refs/heads/master.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
REF, or r() is a nicer alternative to PHP's printr / vardump functions. DEMO ## Requirements ## - (server) PHP 5.3+ (5.4+ displays additional info) - (client) Any browser, except IE 8 and lower of course Installation Copy folder to wp-content/mu-plugins: Usage ## Basic example: // display info about defined classes r(getdeclaredclasses()); // display info about global variables r($GLOBALS); To print in text mode you can use the rt() function instead: rt($var); To terminate the script after the info is dumped, prepend the bitwise NOT operator: ~r($var); // html ~rt($var); // text Prepending the error control operator (@) will return the information: $output = @r($var); // html $output = @rt($var); // text Keyboard shortcuts (javascript must be enabled): - X - collapses / expands all levels - Ctrl + X - toggles display state To modify the global configuration call ref::config(): // example: initially expand first 3 levels ref::config('expLvl', 3); You can also add configuration options in your php.ini file like this: [ref] ref.expLvl = 3 ref.maxDepth = 4 Currently available options and their default