3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php define('KEYS', 1000); $a = array(); function fill(&$arr) { for ($i = 1; $i <= 10; $i++) { $arr['key-' . $i] = $i; } } /*function read_key(&$arr) { for ($i = 1; $i <= KEYS; $i++) { for ($j = 1; $j <= 10; $i++) { $v = $arr['key-' . $i]; } } }*/ function for_each(&$arr) { for ($i = 1; $i <= KEYS; $i++) { foreach ($arr as $key => $value) { $v = $value; } } } fill($a); //read_key($a); for_each($a);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0