3v4l.org

run code in 300+ PHP versions simultaneously
<?php function setAge(int $age) { var_dump($age); } // First test is clearly wrong // setAge("totally not an int"); <-- Fatal error expected int found string // Try passing something like this setAge("30+1"); // What about this? setAge("30"); // Finally a real int :) setAge(30); // U jelly? setAge(.1);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: setAge(): Argument #1 ($age) must be of type int, string given, called in /in/OIDal on line 11 and defined in /in/OIDal:3 Stack trace: #0 /in/OIDal(11): setAge('30+1') #1 {main} thrown in /in/OIDal on line 3
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:
74.47 ms | 401 KiB | 8 Q