3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { public function __destruct() { static $i = 0; $i++; throw new Exception('Foo::__destruct() ' . $i); } } try { var_dump(new Foo() + new Foo()); } catch (Exception $e) { var_dump($e); }
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
object(Exception)#1 (7) { ["message":protected]=> string(19) "Foo::__destruct() 2" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/um5TH" ["line":protected]=> int(7) ["trace":"Exception":private]=> array(1) { [0]=> array(6) { ["file"]=> string(9) "/in/um5TH" ["line"]=> int(12) ["function"]=> string(10) "__destruct" ["class"]=> string(3) "Foo" ["type"]=> string(2) "->" ["args"]=> array(0) { } } } ["previous":"Exception":private]=> object(Exception)#4 (7) { ["message":protected]=> string(19) "Foo::__destruct() 1" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/um5TH" ["line":protected]=> int(7) ["trace":"Exception":private]=> array(1) { [0]=> array(6) { ["file"]=> string(9) "/in/um5TH" ["line"]=> int(12) ["function"]=> string(10) "__destruct" ["class"]=> string(3) "Foo" ["type"]=> string(2) "->" ["args"]=> array(0) { } } } ["previous":"Exception":private]=> object(TypeError)#3 (7) { ["message":protected]=> string(36) "Unsupported operand types: Foo + Foo" ["string":"Error":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/um5TH" ["line":protected]=> int(12) ["trace":"Error":private]=> array(0) { } ["previous":"Error":private]=> NULL } } }

preferences:
78.38 ms | 1365 KiB | 4 Q