I've stumbled upon this error when trying to simulate an error in a context similar to this one:
function foo_init() {
if ( ! class_exists( 'Foo' ) ) {
class Foo extends Bar {
protected function __construct() {
parent::__construct();
add_action( 'init', function () {
if ( rand( 0, 10 ) === 10 ) {
throw new \RuntimeException( 'Simulated error . ' );
}
} );
}
}
}
}
It seems $callback['function'][1] is an array, whereas it should be a string.
This is probably being called in the context of PHP Debug Logger Collector, output_fatal method, while building the stack trace.
Unfortunately I don't have time right now to further debug this. Maybe some kinda of easy defensive programming here could be useful, like a try-catch and skipping the trace if it fails to build it...?
I'm encountering this error:
Pointing to this line.
I've stumbled upon this error when trying to simulate an error in a context similar to this one:
It seems
$callback['function'][1]
is an array, whereas it should be astring
.This is probably being called in the context of PHP Debug Logger Collector, output_fatal method, while building the stack trace.
Unfortunately I don't have time right now to further debug this. Maybe some kinda of easy defensive programming here could be useful, like a try-catch and skipping the trace if it fails to build it...?