Skip to content

Instantly share code, notes, and snippets.

@jmc734
Last active October 7, 2015 03:08
Show Gist options
  • Save jmc734/3095269 to your computer and use it in GitHub Desktop.
Save jmc734/3095269 to your computer and use it in GitHub Desktop.
Readable PHP Object Print
<?php
/**
* @param mixed $expression The expression to be printed
* @param bool $return When true, output string will be returned rather than printed
* @return bool|string When the return parameter is true, the output string will be returned.
* Otherwise, the boolean true will be returned
*/
function print_object($expression , $return = false){
return highlight_string(print_r($expression, true), $return);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment