3v4l.org

run code in 500+ PHP versions simultaneously
<?php final class SkipTryCatchFinallyDifferentType { public function run() { try { return 1; } catch (\RuntimeException $e) { return 2; } finally { return "A"; } } } $a = new SkipTryCatchFinallyDifferentType(); var_dump($a->run());
Output for 8.1.34, 8.2.29 - 8.2.31, 8.3.5 - 8.3.31, 8.4.8 - 8.4.22, 8.5.0 - 8.5.7
string(1) "A"

preferences:
50.6 ms | 632 KiB | 4 Q