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 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
xxx Exception: Class 'A' not found in /in/cod0t:5 Stack trace: #0 /in/cod0t(10): x('A') #1 {main}
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
xxx Exception: Class 'A' not found in /in/cod0t:5 Stack trace: #0 [internal function]: x('A') #1 /in/cod0t(10): spl_autoload_call('A') #2 {main}
Output for 5.3.18 - 5.3.29, 5.4.1 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
xxx exception 'Exception' with message 'Class 'A' not found' in /in/cod0t:5 Stack trace: #0 [internal function]: x('A') #1 /in/cod0t(10): spl_autoload_call('A') #2 {main}
Output for 5.3.3 - 5.3.17, 5.4.0
xxx Fatal error: Class 'A' not found in /in/cod0t on line 10
Process exited with code 255.
Output for 5.3.0 - 5.3.2
xxx Fatal error: Class 'A' not found in /in/cod0t on line 0
Process exited with code 255.
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
xxx Fatal error: Class 'A' not found in /in/cod0t on line 15
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function spl_autoload_register() in /in/cod0t on line 8
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_NEW in /in/cod0t on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected T_NEW in /in/cod0t on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/cod0t on line 5
Process exited with code 255.

preferences:
308.46 ms | 401 KiB | 460 Q