Created
April 12, 2019 20:30
-
-
Save arcticmouse/d21261a3c7617eee8cdead7551618874 to your computer and use it in GitHub Desktop.
var_dump to error_log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function var_error_log( $object=null ){ | |
ob_start(); // start buffer capture | |
var_dump( $object ); // dump the values | |
$contents = ob_get_contents(); // put the buffer into a variable | |
ob_end_clean(); // end capture | |
error_log( $contents ); // log contents of the result of var_dump( $object ) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.justinsilver.com/technology/writing-to-the-php-error_log-with-var_dump-and-print_r/