3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php set_error_handler(function($errorLevel, $errorMessage) { echo 'in set_error_handler' . PHP_EOL; echo 'errorLevel is ' . ($errorLevel == E_RECOVERABLE_ERROR ? '': 'NOT') . 'E_RECOVERABLE_ERROR' . PHP_EOL; echo $errorMessage . PHP_EOL; }); set_exception_handler(function($exception) { echo 'in set_exception_handler' . PHP_EOL; echo 'Exception is ' . get_class($exception) . PHP_EOL; echo $exception->getMessage() . PHP_EOL; }); function a(array $a){} a(null);
based on pu0FD
Output for 7.0.0 - 7.2.6
in set_exception_handler Exception is TypeError Argument 1 passed to a() must be of the type array, null given, called in /in/m4f79 on line 15
Output for hhvm-3.22.0
Fatal error: Uncaught TypeError: Argument 1 passed to a() must be an instance of array, null given in /in/m4f79:-1 Stack trace: #0 /in/m4f79(-1): a() #1 {main} in set_exception_handler Exception is __SystemLib\TypeError Argument 1 passed to a() must be an instance of array, null given
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught TypeError: Argument 1 passed to a() must be an instance of array, null given in /in/m4f79:14 Stack trace: #0 /in/m4f79(15): a() #1 {main} in set_exception_handler Exception is __SystemLib\TypeError Argument 1 passed to a() must be an instance of array, null given
Output for 5.6.0 - 5.6.30
in set_error_handler errorLevel is E_RECOVERABLE_ERROR Argument 1 passed to a() must be of the type array, null given, called in /in/m4f79 on line 15 and defined