3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php define('KEYS', 9999); $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.0.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: arrayobject in /in/ssBIu on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: arrayobject in /in/ssBIu on line 5