3v4l.org

run code in 500+ PHP versions simultaneously
<?php function foo(int $bar) { var_dump($bar); } foo(7); foo(7.0); foo(7.1); foo(7.9); foo('7'); try { foo('7even'); } catch(\Error $e) { echo $e->getMessage() . PHP_EOL; } try { foo('seven'); } catch(\Error $e) { echo $e->getMessage(); }
Output for git.master, git.master_jit, rfc.property-hooks
int(7) int(7) Deprecated: Implicit conversion from float 7.1 to int loses precision in /in/bIF5F on line 3 int(7) Deprecated: Implicit conversion from float 7.9 to int loses precision in /in/bIF5F on line 3 int(7) int(7) foo(): Argument #1 ($bar) must be of type int, string given, called in /in/bIF5F on line 11 foo(): Argument #1 ($bar) must be of type int, string given, called in /in/bIF5F on line 16

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:
61.67 ms | 1295 KiB | 4 Q