2017 © Pedro Peláez
 

library perfect-print

Perfect print function for PHP Debugging

image

tetreum/perfect-print

Perfect print function for PHP Debugging

  • Wednesday, September 13, 2017
  • by tetreum
  • Repository
  • 1 Watchers
  • 2 Stars
  • 3,766 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 8 % Grown

The README.md

perfect-print

Stop wasting your time using print_r, var_dump and echo functions to debug your code. Perfect print for PHP debugging is here., (*1)

Install

composer require tetreum/perfect-print "dev-master"

Example

Having, (*2)

$user = new stdClass();
$user->id = '';
$user->nick = 'luser';
$wrongJson = json_decode('ssdf');

Normal debug, (*3)

echo '<pre>';
print_r($user);
var_dump($wrongJson);

Perfect print, (*4)

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., (*5)

¡Test it yourself!, (*6)

p($obj, 56, false, null, 'sdsf');

The Versions

13/09 2017

dev-master

9999999-dev

Perfect print function for PHP Debugging

  Sources   Download

MIT

debug print