3v4l.org

run code in 300+ PHP versions simultaneously
<?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.4.0 - 7.4.1
0.025 seconds - array_key_exists(array,i) on full array
Output for 7.2.14, 7.3.11, 7.3.13
0.038 seconds - array_key_exists(array,i) on full array
Output for 7.2.1, 7.2.10, 7.2.23, 7.3.12
0.042 seconds - array_key_exists(array,i) on full array
Output for 7.2.3, 7.2.6 - 7.2.9, 7.2.15 - 7.2.16, 7.2.18, 7.2.21, 7.2.24, 7.3.0, 7.3.3, 7.3.5 - 7.3.7, 7.3.10
0.031 seconds - array_key_exists(array,i) on full array
Output for 7.3.9
0.044 seconds - array_key_exists(array,i) on full array
Output for 7.2.0, 7.2.11, 7.2.19, 7.3.2, 7.3.4, 7.3.8
0.033 seconds - array_key_exists(array,i) on full array
Output for 7.2.12, 7.2.17, 7.3.1
0.032 seconds - array_key_exists(array,i) on full array
Output for 7.2.13, 7.2.26
0.036 seconds - array_key_exists(array,i) on full array
Output for 7.2.25
0.039 seconds - array_key_exists(array,i) on full array
Output for 7.2.22
0.045 seconds - array_key_exists(array,i) on full array
Output for 7.2.20
0.037 seconds - array_key_exists(array,i) on full array
Output for 7.2.5
0.043 seconds - array_key_exists(array,i) on full array
Output for 7.2.4
0.041 seconds - array_key_exists(array,i) on full array
Output for 7.2.2
0.034 seconds - array_key_exists(array,i) on full array
Output for 7.0.22, 7.0.30, 7.1.7, 7.1.11 - 7.1.12, 7.1.14, 7.1.16, 7.1.21, 7.1.26, 7.1.28, 7.1.33
0.075 seconds - array_key_exists(array,i) on full array
Output for 7.1.0, 7.1.10, 7.1.32
0.095 seconds - array_key_exists(array,i) on full array
Output for 7.0.2, 7.0.7, 7.0.14, 7.1.31
0.087 seconds - array_key_exists(array,i) on full array
Output for 7.0.3, 7.1.4, 7.1.30
0.078 seconds - array_key_exists(array,i) on full array
Output for 7.1.5, 7.1.29
0.074 seconds - array_key_exists(array,i) on full array
Output for 7.1.27
0.079 seconds - array_key_exists(array,i) on full array
Output for 7.0.19, 7.0.25, 7.0.29, 7.1.15, 7.1.25
0.086 seconds - array_key_exists(array,i) on full array
Output for 7.0.27, 7.0.33, 7.1.24
0.106 seconds - array_key_exists(array,i) on full array
Output for 7.0.15, 7.1.23
0.101 seconds - array_key_exists(array,i) on full array
Output for 7.0.1, 7.0.4, 7.0.21, 7.1.22
0.076 seconds - array_key_exists(array,i) on full array
Output for 7.0.0, 7.1.17, 7.1.20
0.084 seconds - array_key_exists(array,i) on full array
Output for 7.1.13, 7.1.19
0.094 seconds - array_key_exists(array,i) on full array
Output for 7.1.3, 7.1.18
0.080 seconds - array_key_exists(array,i) on full array
Output for 7.1.9
0.109 seconds - array_key_exists(array,i) on full array
Output for 7.0.12, 7.1.8
0.077 seconds - array_key_exists(array,i) on full array
Output for 7.0.10, 7.0.20, 7.0.28, 7.1.6
0.088 seconds - array_key_exists(array,i) on full array
Output for 7.0.31, 7.1.2
0.081 seconds - array_key_exists(array,i) on full array
Output for 7.1.1
0.082 seconds - array_key_exists(array,i) on full array
Output for 7.0.5, 7.0.17, 7.0.32
0.083 seconds - array_key_exists(array,i) on full array
Output for 7.0.26
0.104 seconds - array_key_exists(array,i) on full array
Output for 7.0.13, 7.0.24
0.098 seconds - array_key_exists(array,i) on full array
Output for 7.0.23
0.103 seconds - array_key_exists(array,i) on full array
Output for 7.0.18
0.097 seconds - array_key_exists(array,i) on full array
Output for 7.0.6, 7.0.9, 7.0.16
0.085 seconds - array_key_exists(array,i) on full array
Output for 7.0.11
0.102 seconds - array_key_exists(array,i) on full array
Output for 7.0.8
0.091 seconds - array_key_exists(array,i) on full array
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
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.

preferences:
193.2 ms | 401 KiB | 325 Q