3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function error_handler_first($no, $msg){ echo __FUNCTION__ . PHP_EOL; restore_error_handler(); } function error_handler_second($no, $msg){ echo __FUNCTION__ . PHP_EOL; restore_error_handler(); } set_error_handler(NULL); set_error_handler("error_handler_first"); set_error_handler("error_handler_second"); trigger_error("error1"); trigger_error("error2"); trigger_error("error3"); trigger_error("error4");
Output for 5.5.0 - 7.1.0
error_handler_second error_handler_first error_handler_first error_handler_first
Output for 5.0.5 - 5.4.45
Warning: set_error_handler() expects the argument () to be a valid callback in /in/2cRba on line 13 error_handler_second error_handler_first error_handler_first error_handler_first
Output for 5.0.2 - 5.0.4
Warning: set_error_handler() expects the argument () to be a valid callback in /in/2cRba on line 13 error_handler_second error_handler_second error_handler_second error_handler_second
Output for 5.0.0 - 5.0.1
Warning: set_error_handler() expects the argument () to be a valid callback in /in/2cRba on line 13 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/2cRba on line 9 error_handler_secondPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/2cRba on line 9 error_handler_secondPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/2cRba on line 9 error_handler_secondPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/2cRba on line 9 error_handler_secondPHP_EOL
Output for 4.4.0 - 4.4.9
Warning: set_error_handler() expects argument 1, '', to be a valid callback in /in/2cRba on line 13 error_handler_second error_handler_first error_handler_first error_handler_first
Output for 4.3.10 - 4.3.11
Warning: set_error_handler() expects argument 1, '', to be a valid callback in /in/2cRba on line 13 error_handler_second error_handler_second error_handler_second error_handler_second
Output for 4.3.0 - 4.3.9
Warning: set_error_handler() expects argument 1, '', to be a valid callback in /in/2cRba on line 13 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/2cRba on line 9 error_handler_secondPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/2cRba on line 9 error_handler_secondPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/2cRba on line 9 error_handler_secondPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/2cRba on line 9 error_handler_secondPHP_EOL