3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace std { function array_shift(array &$array): mixed { foreach ($array as $key => $item) { unset($array[$key]); return $item; } return null; } } namespace { $preflight = microtime(true); $foo = ['bar', 123, 'baz', true]; $start = microtime(true); var_dump(array_shift($foo), $foo); $end = microtime(true); printf("%0.6fs\n", $end - $start); $foo = ['bar', 123, 'baz', true]; $start = microtime(true); var_dump(std\array_shift($foo), $foo); $end = microtime(true); printf("%0.6fs\n", $end - $start); }
Output for git.master
string(3) "bar" array(3) { [0]=> int(123) [1]=> string(3) "baz" [2]=> bool(true) } 0.000024s string(3) "bar" array(3) { [1]=> int(123) [2]=> string(3) "baz" [3]=> bool(true) } 0.000019s

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:
17.08 ms | 401 KiB | 6 Q