<?php
for ($i = 0; $i < 100000; $i++) {
$GLOBALS["a$i"] = rand(0, 1000000);
}
$start = microtime(true);
for ($runs = 1000; $runs > 0; $runs--) {
array_key_exists('a1111111', $GLOBALS);
}
$end = microtime(true);
printf("[GLOBALS]array_key_exists() took %.5f seconds\n", $end - $start);
- Output for 8.1.0 - 8.1.5, 8.1.7 - 8.1.18, 8.2.0 - 8.2.3, 8.2.5
Process exited with code 137.- Output for 8.2.4
- [GLOBALS]array_key_exists() took 1.76232 seconds
- Output for 8.1.6
- [GLOBALS]array_key_exists() took 1.99284 seconds
- Output for 7.4.2, 7.4.5 - 7.4.6, 7.4.10, 7.4.12 - 7.4.13, 7.4.15, 7.4.23, 7.4.26 - 7.4.28, 8.0.2 - 8.0.6, 8.0.10 - 8.0.11, 8.0.14, 8.0.16, 8.0.19 - 8.0.22, 8.0.25, 8.0.27 - 8.0.28
- [GLOBALS]array_key_exists() took 0.00002 seconds
- Output for 7.4.0 - 7.4.1, 7.4.4, 7.4.7 - 7.4.8, 7.4.11, 7.4.14, 7.4.16 - 7.4.22, 7.4.24 - 7.4.25, 7.4.29 - 7.4.30, 7.4.33, 8.0.1, 8.0.7 - 8.0.9, 8.0.12 - 8.0.13, 8.0.15, 8.0.18, 8.0.24, 8.0.26
- [GLOBALS]array_key_exists() took 0.00003 seconds
- Output for 7.4.3, 7.4.32, 8.0.23
- [GLOBALS]array_key_exists() took 0.00004 seconds
- Output for 8.0.17
- [GLOBALS]array_key_exists() took 0.00015 seconds
- Output for 7.4.9
- [GLOBALS]array_key_exists() took 0.00006 seconds
preferences:
98.73 ms | 401 KiB | 89 Q