3v4l.org

run code in 300+ PHP versions simultaneously
<?php function A() { try { b(); } catch(Exception $e) { echo "Exceptin caught in " . __CLASS__; } } function B() { C(); } try { A(); } catch(Exception $e) { echo "Error caught in global scope: " . $e->getMessage(); }
Output for 7.0.0 - 7.0.33, 7.1.0, 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Call to undefined function C() in /in/XumH8:11 Stack trace: #0 /in/XumH8(4): B() #1 /in/XumH8(16): A() #2 {main} thrown in /in/XumH8 on line 11
Process exited with code 255.

preferences:
87.32 ms | 402 KiB | 93 Q