3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function bar($t, $m) { echo $m;} function foo() { echo 'X'; restore_error_handler(); $a = $c; } set_error_handler(array('bar','too')); set_error_handler('foo'); $a = $b; print_r( set_error_handler('var_dump') );
based on biEAs
Output for 5.0.4 - 7.1.0
Warning: set_error_handler() expects the argument (bar::too) to be a valid callback in /in/7Sa0H on line 10 X Notice: Undefined variable: c in /in/7Sa0H on line 7 foo
Output for 5.0.0 - 5.0.3
Warning: set_error_handler() expects the argument (bar::too) to be a valid callback in /in/7Sa0H on line 10 X Notice: Undefined variable: c in /in/7Sa0H on line 7 foo
Output for 4.3.0 - 4.4.9
Warning: set_error_handler() expects argument 1, 'bar::too', to be a valid callback in /in/7Sa0H on line 10 X Notice: Undefined variable: c in /in/7Sa0H on line 7 foo