{"id":19145198,"url":"https://github.com/mihdan/mihdan-php-ref","last_synced_at":"2026-05-12T12:39:16.287Z","repository":{"id":148961969,"uuid":"141463946","full_name":"mihdan/mihdan-php-ref","owner":"mihdan","description":"WordPress plugin: a better alternative to print_r / var_dump","archived":false,"fork":false,"pushed_at":"2018-07-20T09:51:13.000Z","size":115,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-22T19:42:20.834Z","etag":null,"topics":["debug","debugging","php","php5","php7","wordpress","wordpress-development","wordpress-plugin"],"latest_commit_sha":null,"homepage":"https://www.kobzarev.com/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mihdan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-18T16:52:00.000Z","updated_at":"2019-09-06T13:16:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"0850ad81-fba4-4e66-82f5-a40c00c74a43","html_url":"https://github.com/mihdan/mihdan-php-ref","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mihdan/mihdan-php-ref","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mihdan%2Fmihdan-php-ref","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mihdan%2Fmihdan-php-ref/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mihdan%2Fmihdan-php-ref/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mihdan%2Fmihdan-php-ref/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mihdan","download_url":"https://codeload.github.com/mihdan/mihdan-php-ref/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mihdan%2Fmihdan-php-ref/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32940101,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-12T09:19:52.626Z","status":"ssl_error","status_checked_at":"2026-05-12T09:17:33.438Z","response_time":102,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debug","debugging","php","php5","php7","wordpress","wordpress-development","wordpress-plugin"],"created_at":"2024-11-09T07:38:43.364Z","updated_at":"2026-05-12T12:39:16.273Z","avatar_url":"https://github.com/mihdan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"REF, or `r()` is a nicer alternative to PHP's [`print_r`](http://php.net/manual/en/function.print-r.php) / [`var_dump`](http://php.net/manual/en/function.var-dump.php) functions.\n\n## [DEMO](http://dev.digitalnature.eu/php-ref/) ##\n\n## Requirements ##\n\n- (server) PHP 5.3+ (5.4+  displays additional info)\n- (client) Any browser, except IE 8 and lower of course\n\n## Installation\n\nCopy folder to `wp-content/mu-plugins`:\n\n## Usage ##\n\nBasic example:\n\n    // display info about defined classes\n    r(get_declared_classes());\n\n    // display info about global variables\n    r($GLOBALS);\n\nTo print in text mode you can use the `rt()` function instead:\n\n    rt($var);\n\nTo terminate the script after the info is dumped, prepend the bitwise NOT operator:\n\n    ~r($var);   // html\n    ~rt($var);  // text\n\nPrepending the error control operator (@) will return the information:\n\n    $output = @r($var);   // html\n    $output = @rt($var);  // text\n\nKeyboard shortcuts (javascript must be enabled):\n\n- `X` - collapses / expands all levels\n- `Ctrl` + `X` - toggles display state\n\nTo modify the global configuration call `ref::config()`:\n\n    // example: initially expand first 3 levels\n    ref::config('expLvl', 3);\n\nYou can also add configuration options in your `php.ini` file like this:\n\n    [ref]\n    ref.expLvl = 3\n    ref.maxDepth = 4\n\nCurrently available options and their default values:\n\n| Option                    | Default             | Description\n|:------------------------- |:------------------- |:-----------------------------------------------\n| `'expLvl'`                | `1`                 | Initially expanded levels (for HTML mode only). A negative value will expand all levels\n| `'maxDepth'`              | `6`                 | Maximum depth (`0` to disable); note that disabling it or setting a high value can produce a 100+ MB page when input involves large data\n| `'showIteratorContents'`  | `FALSE`             | Display iterator data (keys and values)\n| `'showResourceInfo'`      | `TRUE`              | Display additional information about resources\n| `'showMethods'`           | `TRUE`              | Display methods and parameter information on objects\n| `'showPrivateMembers'`    | `FALSE`             | Include private properties and methods\n| `'showStringMatches'`     | `TRUE`              | Perform and display string matches for dates, files, json strings, serialized data, regex patterns etc. (SLOW)\n| `'formatters'`            | `array()`           | Custom/external formatters (as associative array: format =\u003e className)\n| `'shortcutFunc'`          | `array('r', 'rt')`  | Shortcut functions used to detect the input expression. If they are namespaced, the namespace must be present as well (methods are not  supported)\n| `'stylePath'`             | `'{:dir}/ref.css'`  | Local path to a custom stylesheet (HTML only); `FALSE` means that no CSS is included.\n| `'scriptPath'`            | `'{:dir}/ref.js'`   | Local path to a custom javascript (HTML only); `FALSE` means no javascript (tooltips / toggle / kbd shortcuts require JS)\n| `'showUrls'`              | `FALSE`             | Gets information about URLs. Setting to false can improve performance (requires showStringMatches to be TRUE)\n| `'timeout'`               | `10`                | Stop execution after this amount of seconds, forcing an incomplete listing. Applies to all calls\n| `'validHtml'`             | `FALSE`             | For HTML mode only. Whether to produce W3C-valid HTML (larger code output) or unintelligible, potentially browser-incompatible but much smaller code output\n\n## Similar projects\n\n- [Kint](http://raveren.github.io/kint/)\n- [dump_r](https://github.com/leeoniya/dump_r.php)\n- [Krumo](http://sourceforge.net/projects/krumo/)\n- [dBug](http://dbug.ospinto.com/)\n- [symfony-vardumper](http://www.sitepoint.com/var_dump-introducing-symfony-vardumper/)\n\n\n## TODOs\n\n- Inherit DocBlock comments from parent or prototype, if missing\n- Refactor \"bubbles\" (for text-mode)\n- Correctly indent multi-line strings (text-mode)\n- Move separator tokens to ::before and ::after pseudo-elements (html-mode)\n\n\n## License\n\nhttp://opensource.org/licenses/mit-license.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmihdan%2Fmihdan-php-ref","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmihdan%2Fmihdan-php-ref","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmihdan%2Fmihdan-php-ref/lists"}