Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alddesign/php-xout
A more readable, syntax highlighted implementation of PHPs var_dump() or print_r() function
https://github.com/alddesign/php-xout
php php-5-4 php-5-6 php-7-4 php-8 php-debuging php-helpers syntax-highlighting
Last synced: about 1 month ago
JSON representation
A more readable, syntax highlighted implementation of PHPs var_dump() or print_r() function
- Host: GitHub
- URL: https://github.com/alddesign/php-xout
- Owner: alddesign
- Created: 2020-11-29T13:55:03.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-07-19T21:54:43.000Z (4 months ago)
- Last Synced: 2024-09-29T20:03:24.867Z (about 2 months ago)
- Topics: php, php-5-4, php-5-6, php-7-4, php-8, php-debuging, php-helpers, syntax-highlighting
- Language: PHP
- Homepage:
- Size: 49.8 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# php-xout
A more readable, syntax highlighted implementation of PHPs `var_dump()` or `print_r()` function.
*Compatible with all PHP versions **back to 5.4***## Installation
### Via Composer
`composer require alddesign/php-xout`
### Manual
Downlaod the package and load `xout.php`:
```php
require_once 'xout.php'
```## Usage
```php
//code before...
$array =
[
'cars' => ['audi','bmw','volkswagen'],
'settings' => (object)
[
'drive' => true,
'disable_car' =>
function(){}
],
'value' => 220.25,
'active' => null
];//Call xout
Xout::xout($array);//Or use the shorthand function:
xout($var);
```The output will look like this:
![output]()## Remarks
### Parameters
- **value**: The expression to output
- **return** (bool): If set to `true` the resulting html is being returned insted of echoing it. Default: `false`
- **dontDie** (bool): If set to `true` the script will not terminated. When `return` is set to `true`, this parameter has no effect. Default: `false`### Customization
In `xout.php` you can change many options like font, color, brace style,...