3v4l.org

run code in 300+ PHP versions simultaneously
<?php function x($class); { print "xxx\n"; // gets printed throw new Exception("Class '{$class}' not found"); } spl_autoload_register('x'); try { $a = A::z(); // FATAL ERROR: class 'A' not found // NOTE: // $a = A::$z; - will be correctly caught } catch (Exception $ex) { print "{$ex}\n"; // never gets executed }
Output for 5.3.0 - 5.3.18, 5.4.0 - 5.4.8
Parse error: syntax error, unexpected ';', expecting '{' in IB2nO on line 2
Process exited with code 255.

preferences:
169.72 ms | 1395 KiB | 35 Q