3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $n = 1000000; // Create test array $i = 0; $array = array(); while($i < $n) { $array[$i++] = true; } $time_start = microtime(true); $i = 0; while ($i < $n) { $devnull = array_key_exists($i++, $array); } $time_end = microtime(true); $time_while1= $time_end-$time_start; echo number_format($time_while1, 3, '.', '') ." seconds - array_key_exists(array,i) on full array \n";
Output for 7.1.0
0.038 seconds - array_key_exists(array,i) on full array
Output for 7.0.14
0.050 seconds - array_key_exists(array,i) on full array
Output for 7.0.0, 7.0.2, 7.0.6
0.025 seconds - array_key_exists(array,i) on full array
Output for 7.0.4 - 7.0.5
0.028 seconds - array_key_exists(array,i) on full array
Output for 7.0.3
0.024 seconds - array_key_exists(array,i) on full array
Output for 7.0.1
0.031 seconds - array_key_exists(array,i) on full array
Output for hhvm-3.12.0
0.077 seconds - array_key_exists(array,i) on full array
Output for hhvm-3.10.0
0.060 seconds - array_key_exists(array,i) on full array
Output for 5.3.0 - 5.6.28
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /in/BEOGf on line 9
Process exited with code 255.
Output for 5.2.2, 5.2.6 - 5.2.17
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 71 bytes) in /in/BEOGf on line 9
Process exited with code 255.
Output for 5.2.1, 5.2.3 - 5.2.5
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 24 bytes) in /in/BEOGf on line 9
Process exited with code 255.
Output for 5.2.0
0.172 seconds - array_key_exists(array,i) on full array
Output for 5.1.6
0.162 seconds - array_key_exists(array,i) on full array
Output for 5.1.5
0.210 seconds - array_key_exists(array,i) on full array
Output for 5.1.4
0.160 seconds - array_key_exists(array,i) on full array
Output for 5.1.3
0.204 seconds - array_key_exists(array,i) on full array
Output for 5.1.0, 5.1.2
0.176 seconds - array_key_exists(array,i) on full array
Output for 5.1.1
0.168 seconds - array_key_exists(array,i) on full array
Output for 5.0.5
0.468 seconds - array_key_exists(array,i) on full array
Output for 5.0.4
0.563 seconds - array_key_exists(array,i) on full array
Output for 5.0.3
0.387 seconds - array_key_exists(array,i) on full array
Output for 5.0.2
0.491 seconds - array_key_exists(array,i) on full array
Output for 5.0.1
0.413 seconds - array_key_exists(array,i) on full array
Output for 4.3.11, 5.0.0
0.417 seconds - array_key_exists(array,i) on full array
Output for 4.4.9
0.399 seconds - array_key_exists(array,i) on full array
Output for 4.4.8
0.415 seconds - array_key_exists(array,i) on full array
Output for 4.4.7
0.401 seconds - array_key_exists(array,i) on full array
Output for 4.4.6
0.392 seconds - array_key_exists(array,i) on full array
Output for 4.4.5
-0.600 seconds - array_key_exists(array,i) on full array
Output for 4.4.4
-0.581 seconds - array_key_exists(array,i) on full array
Output for 4.4.3
0.383 seconds - array_key_exists(array,i) on full array
Output for 4.4.2
0.398 seconds - array_key_exists(array,i) on full array
Output for 4.4.1
0.414 seconds - array_key_exists(array,i) on full array
Output for 4.4.0
0.431 seconds - array_key_exists(array,i) on full array
Output for 4.3.10
0.467 seconds - array_key_exists(array,i) on full array
Output for 4.3.9
0.419 seconds - array_key_exists(array,i) on full array
Output for 4.3.8
0.403 seconds - array_key_exists(array,i) on full array
Output for 4.3.7
-0.574 seconds - array_key_exists(array,i) on full array
Output for 4.3.6
-0.592 seconds - array_key_exists(array,i) on full array
Output for 4.3.5
-0.601 seconds - array_key_exists(array,i) on full array
Output for 4.3.4
0.386 seconds - array_key_exists(array,i) on full array
Output for 4.3.3
0.408 seconds - array_key_exists(array,i) on full array
Output for 4.3.2
0.412 seconds - array_key_exists(array,i) on full array
Output for 4.3.1
-0.608 seconds - array_key_exists(array,i) on full array
Output for 4.3.0

Process exited with code 137.