3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); 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/b16nd on line 12 and defined in /in/b16nd:4 Stack trace: #0 /in/b16nd(12): setAge('30+1') #1 {main} thrown in /in/b16nd on line 4
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:
72.73 ms | 401 KiB | 8 Q