3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(int $foo, int $bar) { echo $foo + $bar; } var_dump(foo(1, 1)); // affiche 2 var_dump(foo(1, '1')); // affiche 2 (conversion car mode coercitif) var_dump(foo('a', 1));
Output for git.master, git.master_jit, rfc.property-hooks
2NULL 2NULL Fatal error: Uncaught TypeError: foo(): Argument #1 ($foo) must be of type int, string given, called in /in/T66P1 on line 10 and defined in /in/T66P1:3 Stack trace: #0 /in/T66P1(10): foo('a', 1) #1 {main} thrown in /in/T66P1 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:
52.24 ms | 401 KiB | 8 Q