3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test(): int { try { return 5; } finally { try { // NOOP } catch(Exception $e) { // NOOP var_export($e); die("catch"); } catch(TypeError $e) { var_dump($e); die("typeerror"); } finally { // NOOP die("finally"); } } } $a = test(); if($a !== 5) { echo "FAILED: expected 5, recieved ", var_export($a), PHP_EOL; } else { echo "Passed", PHP_EOL; }
based on D9Z4r
Output for 7.0.0 - 7.3.0rc4
finally
Output for 5.5.0 - 5.6.28
Parse error: syntax error, unexpected ':', expecting '{' in /in/8GgOe on line 3
Process exited with code 255.