3v4l.org

run code in 300+ PHP versions simultaneously
<?php // First, some magic! function custom_error_handler($level, $message, $file = '', $line = 0, $context = array()) { if (error_reporting() & $level) { throw new Exception($message, 0, $level, $file, $line); } } set_error_handler('custom_error_handler'); error_reporting(0); // Yeah, not the best solution class SomeClass {} function test(SomeClass $instance) { echo 'wtf: '.$instance; } // NOTE: E_RECOVERABLE_ERROR (4096) occurs here test(1);

preferences:
29.43 ms | 402 KiB | 5 Q