3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = 53; $items = array(1, 22, 77, 53, 34, 51, 56); $runtimes = 0; function find($needle, array $haystack, $cursor = 0) { $GLOBAL['runtimes'] ++; if (!isset($haystack[$cursor])) { return false; } if ($needle === $haystack[$cursor]) { return $cursor; } return find($needle, $haystack, $cursor + 1); } $retval = find($value, $items); printf($runtimes . PHP_EOL); var_dump($retval);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $GLOBAL in /in/KH48E on line 8 Warning: Undefined array key "runtimes" in /in/KH48E on line 8 Warning: Undefined variable $GLOBAL in /in/KH48E on line 8 Warning: Undefined array key "runtimes" in /in/KH48E on line 8 Warning: Undefined variable $GLOBAL in /in/KH48E on line 8 Warning: Undefined array key "runtimes" in /in/KH48E on line 8 Warning: Undefined variable $GLOBAL in /in/KH48E on line 8 Warning: Undefined array key "runtimes" in /in/KH48E on line 8 0 int(3)

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:
56.34 ms | 402 KiB | 8 Q