3v4l.org

run code in 300+ PHP versions simultaneously
<?php function doSomething(string $value) : int { try { $value .= " test" / 34; } catch(Throwable $e) { var_dump($e); } return $value; } echo doSomething("Hello");
Output for git.master, git.master_jit, rfc.property-hooks
object(TypeError)#1 (7) { ["message":protected]=> string(39) "Unsupported operand types: string / int" ["string":"Error":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/r3kbD" ["line":protected]=> int(6) ["trace":"Error":private]=> array(1) { [0]=> array(4) { ["file"]=> string(9) "/in/r3kbD" ["line"]=> int(13) ["function"]=> string(11) "doSomething" ["args"]=> array(1) { [0]=> string(5) "Hello" } } } ["previous":"Error":private]=> NULL } Fatal error: Uncaught TypeError: doSomething(): Return value must be of type int, string returned in /in/r3kbD:10 Stack trace: #0 /in/r3kbD(13): doSomething('Hello') #1 {main} thrown in /in/r3kbD on line 10
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
47.79 ms | 402 KiB | 8 Q