'; $call_stack_string .= implode(' -> ', $functions); } if ($call_with_file) { $file_name = $call_with_file['file']; if (substr_compare($file_name, $root_dir, 0, strlen($root_dir)) === 0) { $file_name = substr($file_name, strlen($root_dir) + 1); } $call_stack_string .= ' in '.$file_name.':'.$call_with_file['line']; } return $call_stack_string; } set_error_handler(function ($errno, $errstr, $errfile, $errline) { // Check if error control operator was used. if (error_reporting() & $errno) { file_put_contents(PHPUNIT_ERROR_LOG, $errstr.' ['.formatCallStack()."]\n", FILE_APPEND); } return zbx_err_handler($errno, $errstr, $errfile, $errline); }, E_ALL | E_STRICT); set_exception_handler(function ($exception) { file_put_contents(PHPUNIT_ERROR_LOG, $exception."\n", FILE_APPEND); }); }