Skip to content

Instantly share code, notes, and snippets.

@arcticmouse
Created April 12, 2019 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arcticmouse/d21261a3c7617eee8cdead7551618874 to your computer and use it in GitHub Desktop.
Save arcticmouse/d21261a3c7617eee8cdead7551618874 to your computer and use it in GitHub Desktop.
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