from: https://www.justinsilver.com/technology/writing-to-the-php-error_log-with-var_dump-and-print_r/
A little debugging tip, if not aforementioned:
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 )
}
$object = $variableToLog;
var_error_log( $object );
This is quite neat. One pitfall, though, is that xdebug adds a html transform and trims large or deep arrays. I use var_export to get the entire array.
error_log(var_export($message, true));
To get it into SMF's log is very similar
log_error(var_export($message, true));
https://support.simplemachines.org/function_db/index.php?action=view_function;id=42
Thanks for the tips - writing to a file is preferable to writing to the screen, I discovered ... I am only a novice but looking into variables has helped me with debugging my huge amounts of mod interactions.