3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('KEYS', 99999); $a = new ArrayObject(); function fill(&$arr) { for ($i = 1; $i <= KEYS; $i++) { $arr['key-' . $i] = $i; } } function read_key(&$arr) { for ($i = 1; $i <= KEYS; $i++) { $v = $arr['key-' . $i]; } } function for_each(&$arr) { foreach ($arr as $key => $value) { $v = $value; } } fill($a); read_key($a); for_each($a);
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 7.2.29 - 7.2.33, 7.3.16 - 7.3.33, 7.4.3 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6

preferences:
148.9 ms | 404 KiB | 215 Q