tetreum / perfect-print
Perfect print function for PHP Debugging
Installs: 27 527
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 0
Open Issues: 0
This package is auto-updated.
Last update: 2025-01-04 17:07:47 UTC
README
Stop wasting your time using print_r, var_dump and echo functions to debug your code. Perfect print for PHP debugging is here.
Install
composer require tetreum/perfect-print "dev-master"
Example
Having
$user = new stdClass(); $user->id = ''; $user->nick = 'luser'; $wrongJson = json_decode('ssdf');
Normal debug
echo '<pre>'; print_r($user); var_dump($wrongJson);
Perfect print
p($user, $wrongJson);
Perfect print will automatically add and close <pre>
tag for better view and also will make a separation space by using <br>
or \n
if you are in cli.
¡Test it yourself!
p($obj, 56, false, null, 'sdsf');