3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "\n"; class ArrayUtils { public static function isAssoc1(array $array) { self::completeArguments1($array); return $array['c']; } public static function isAssoc2(array $array) { $array = self::completeArguments2($array); return $array['c']; } public static function completeArguments1(array &$arguments) { if (!isset($arguments['c'])) { $arguments['c'] = 3; } } public static function completeArguments2(array $arguments) { if (!isset($arguments['c'])) { $arguments['c'] = 3; } return $arguments; } } $a1 = ['a' => 1, 'b' => 2, 'd' => 4]; $a2 = ['a' => 1, 'b' => 2, 'c' => 3, 'd' => 4]; $size = 100000; for ($i = 0; $i < $size; $i++) { ArrayUtils::isAssoc1($a2); }
Output for git.master, git.master_jit, rfc.property-hooks

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:
49.37 ms | 401 KiB | 8 Q