3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { (function () { return "string" + throw null ?? throw new Exception('return throw null ?? throw new Exception();'); })(); } catch (Exception $e) { var_dump($e->getMessage()); } try { (function () { return "string1" . 5 . "ok" / throw throw throw throw new Exception("cool"); })(); } catch (Exception $e) { var_dump($e->getMessage()); }
Output for 8.1.32, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14
string(43) "return throw null ?? throw new Exception();" string(4) "cool"

preferences:
74.77 ms | 406 KiB | 5 Q