Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
var_dump to error_log
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