3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array(); for ($i = 0; $i < 10000; ++$i) { $v = rand(1, 1000000); $a[$v] = $v; } echo "Size: ", count($a), PHP_EOL; $start = microtime( true ); for ($i = 0; $i < 10000; ++$i) { isset($a[rand(1, 1000000)]); } $total_time = microtime( true ) - $start; echo "Total time isset: ", number_format($total_time, 6), PHP_EOL; $start = microtime( true ); for ($i = 0; $i < 10000; ++$i) { in_array(rand(1, 1000000), $a); } $total_time = microtime( true ) - $start; echo "Total time in_array: ", number_format($total_time, 6), PHP_EOL;
based on 0hubD
Output for 7.1.0
Size: 9964 Total time isset: 0.001443 Total time in_array: 0.178813
Output for 7.0.14
Size: 9959 Total time isset: 0.001282 Total time in_array: 0.161997
Output for 7.0.6
Size: 9943 Total time isset: 0.001271 Total time in_array: 0.171738
Output for 7.0.5
Size: 9952 Total time isset: 0.000787 Total time in_array: 0.142477
Output for 7.0.4
Size: 9957 Total time isset: 0.001256 Total time in_array: 0.174942
Output for 7.0.3
Size: 9947 Total time isset: 0.001048 Total time in_array: 0.162194
Output for 7.0.2
Size: 9948 Total time isset: 0.001041 Total time in_array: 0.157230
Output for 7.0.1
Size: 9950 Total time isset: 0.000910 Total time in_array: 0.158368
Output for 7.0.0
Size: 9952 Total time isset: 0.000807 Total time in_array: 0.148937
Output for hhvm-3.12.0
Size: 9946 Total time isset: 0.001294 Total time in_array: 0.902709
Output for hhvm-3.10.0
Size: 9951 Total time isset: 0.001706 Total time in_array: 0.913270
Output for 5.6.28
Size: 9948 Total time isset: 0.003687 Total time in_array: 0.922320
Output for 5.6.21
Size: 9943 Total time isset: 0.002412 Total time in_array: 1.409012
Output for 5.6.20
Size: 9938 Total time isset: 0.002047 Total time in_array: 1.385440
Output for 5.6.19
Size: 9960 Total time isset: 0.003882 Total time in_array: 1.394281
Output for 5.6.18
Size: 9947 Total time isset: 0.001473 Total time in_array: 1.352887
Output for 5.6.17
Size: 9960 Total time isset: 0.002252 Total time in_array: 1.391839
Output for 5.6.16
Size: 9950 Total time isset: 0.002270 Total time in_array: 1.412454
Output for 5.6.15
Size: 9950 Total time isset: 0.002801 Total time in_array: 1.407842
Output for 5.6.14
Size: 9949 Total time isset: 0.001427 Total time in_array: 1.356430
Output for 5.6.13
Size: 9962 Total time isset: 0.002867 Total time in_array: 1.386935
Output for 5.6.12
Size: 9940 Total time isset: 0.001350 Total time in_array: 1.336262
Output for 5.6.11
Size: 9966 Total time isset: 0.002318 Total time in_array: 1.515980
Output for 5.6.10
Size: 9959 Total time isset: 0.002113 Total time in_array: 1.397492
Output for 5.6.9
Size: 9938 Total time isset: 0.001553 Total time in_array: 1.369467
Output for 5.6.8
Size: 9942 Total time isset: 0.001359 Total time in_array: 1.337684
Output for 5.6.7
Size: 9947 Total time isset: 0.002379 Total time in_array: 1.349222
Output for 5.5.35
Size: 9945 Total time isset: 0.002201 Total time in_array: 1.284073
Output for 5.5.34
Size: 9948 Total time isset: 0.002090 Total time in_array: 1.385322
Output for 5.5.33
Size: 9951 Total time isset: 0.001387 Total time in_array: 1.373010
Output for 5.5.32
Size: 9954 Total time isset: 0.002405 Total time in_array: 1.402203
Output for 5.5.31
Size: 9954 Total time isset: 0.001453 Total time in_array: 1.345983
Output for 5.5.30
Size: 9966 Total time isset: 0.001377 Total time in_array: 1.333705
Output for 5.5.29
Size: 9958 Total time isset: 0.002421 Total time in_array: 1.396031
Output for 5.5.28
Size: 9955 Total time isset: 0.001408 Total time in_array: 1.363851
Output for 5.5.27
Size: 9946 Total time isset: 0.002132 Total time in_array: 1.389509
Output for 5.5.26
Size: 9955 Total time isset: 0.002402 Total time in_array: 1.399986
Output for 5.5.25
Size: 9956 Total time isset: 0.002242 Total time in_array: 1.384518
Output for 5.5.24
Size: 9957 Total time isset: 0.002344 Total time in_array: 1.384032
Output for 5.4.45
Size: 9949 Total time isset: 0.002018 Total time in_array: 1.331231
Output for 5.4.44
Size: 9947 Total time isset: 0.001401 Total time in_array: 1.293856
Output for 5.4.43
Size: 9954 Total time isset: 0.001438 Total time in_array: 1.298420
Output for 5.4.42
Size: 9953 Total time isset: 0.002223 Total time in_array: 1.341235
Output for 5.4.41
Size: 9948 Total time isset: 0.001874 Total time in_array: 1.488321
Output for 5.4.40
Size: 9938 Total time isset: 0.001385 Total time in_array: 1.277253
Output for 5.4.39
Size: 9951 Total time isset: 0.001434 Total time in_array: 1.269914
Output for 5.4.38
Size: 9947 Total time isset: 0.001676 Total time in_array: 1.305099
Output for 5.4.37
Size: 9947 Total time isset: 0.001473 Total time in_array: 1.303318
Output for 5.4.36
Size: 9950 Total time isset: 0.001403 Total time in_array: 1.300015
Output for 5.4.35
Size: 9960 Total time isset: 0.002208 Total time in_array: 1.325869
Output for 5.4.34
Size: 9943 Total time isset: 0.001871 Total time in_array: 1.482075
Output for 5.4.32
Size: 9949 Total time isset: 0.001892 Total time in_array: 1.442058
Output for 5.4.31
Size: 9938 Total time isset: 0.001834 Total time in_array: 1.523652
Output for 5.4.30
Size: 9950 Total time isset: 0.001858 Total time in_array: 1.463429
Output for 5.4.29
Size: 9948 Total time isset: 0.001911 Total time in_array: 1.419568
Output for 5.4.28
Size: 9962 Total time isset: 0.001836 Total time in_array: 1.496878
Output for 5.4.27
Size: 9962 Total time isset: 0.002515 Total time in_array: 1.510611
Output for 5.4.26
Size: 9948 Total time isset: 0.001820 Total time in_array: 1.490131
Output for 5.4.25
Size: 9943 Total time isset: 0.001861 Total time in_array: 2.201877
Output for 5.4.24
Size: 9944 Total time isset: 0.018277
Process exited with code 137.
Output for 5.4.23
Size: 9957 Total time isset: 0.002418
Process exited with code 137.
Output for 5.4.22
Size: 9954 Total time isset: 0.002976
Process exited with code 137.
Output for 5.4.21
Size: 9952 Total time isset: 0.009831
Process exited with code 137.
Output for 5.4.20
Size: 9959 Total time isset: 0.009281 Total time in_array: 2.381205
Output for 5.4.19
Size: 9961 Total time isset: 0.001451 Total time in_array: 1.293167
Output for 5.4.18
Size: 9950 Total time isset: 0.002038 Total time in_array: 1.320503
Output for 5.4.17
Size: 9956 Total time isset: 0.002180 Total time in_array: 1.313306
Output for 5.4.16
Size: 9949 Total time isset: 0.002636 Total time in_array: 1.538082
Output for 5.4.15
Size: 9945 Total time isset: 0.001395 Total time in_array: 1.249455
Output for 5.4.14
Size: 9942 Total time isset: 0.001445 Total time in_array: 1.315094
Output for 5.4.13
Size: 9947 Total time isset: 0.001436 Total time in_array: 1.323470
Output for 5.4.12
Size: 9949 Total time isset: 0.001608 Total time in_array: 1.332218
Output for 5.4.11
Size: 9962 Total time isset: 0.001623 Total time in_array: 1.285271
Output for 5.4.10
Size: 9954 Total time isset: 0.001384 Total time in_array: 1.269869
Output for 5.4.9
Size: 9954 Total time isset: 0.001452 Total time in_array: 1.260122
Output for 5.4.8
Size: 9953 Total time isset: 0.001496 Total time in_array: 1.295321
Output for 5.4.7
Size: 9950 Total time isset: 0.002231 Total time in_array: 1.327148
Output for 5.4.6
Size: 9951 Total time isset: 0.002389 Total time in_array: 1.401562
Output for 5.4.5
Size: 9946 Total time isset: 0.002032 Total time in_array: 1.312284
Output for 5.4.4
Size: 9946 Total time isset: 0.001387 Total time in_array: 1.287393
Output for 5.4.3
Size: 9944 Total time isset: 0.002287 Total time in_array: 1.332750
Output for 5.4.2
Size: 9949 Total time isset: 0.002348 Total time in_array: 1.320032
Output for 5.4.1
Size: 9950 Total time isset: 0.001816 Total time in_array: 1.368446
Output for 5.4.0
Size: 9961 Total time isset: 0.001439 Total time in_array: 1.321748
Output for 5.3.29
Size: 9942 Total time isset: 0.001505 Total time in_array: 1.320232
Output for 5.3.28
Size: 9955 Total time isset: 0.001638 Total time in_array: 1.329941
Output for 5.3.27
Size: 9936 Total time isset: 0.001608 Total time in_array: 1.325292
Output for 5.3.26
Size: 9949 Total time isset: 0.001546 Total time in_array: 1.330673
Output for 5.3.25
Size: 9948 Total time isset: 0.001565 Total time in_array: 1.318914
Output for 5.3.24
Size: 9944 Total time isset: 0.001698 Total time in_array: 1.342040
Output for 5.3.23
Size: 9957 Total time isset: 0.001588 Total time in_array: 1.334539
Output for 5.3.22
Size: 9946 Total time isset: 0.001586 Total time in_array: 1.296466
Output for 5.3.21
Size: 9964 Total time isset: 0.001764 Total time in_array: 1.313667
Output for 5.3.20
Size: 9967 Total time isset: 0.004749 Total time in_array: 1.371368
Output for 5.3.19
Size: 9950 Total time isset: 0.002168 Total time in_array: 1.298758
Output for 5.3.18
Size: 9951 Total time isset: 0.001595 Total time in_array: 1.304634
Output for 5.3.17
Size: 9959 Total time isset: 0.002542 Total time in_array: 1.333175
Output for 5.3.16
Size: 9955 Total time isset: 0.001957 Total time in_array: 1.336625
Output for 5.3.15
Size: 9951 Total time isset: 0.003068 Total time in_array: 1.576208
Output for 5.3.14
Size: 9955 Total time isset: 0.002079 Total time in_array: 1.301714
Output for 5.3.13
Size: 9951 Total time isset: 0.001757 Total time in_array: 1.296423
Output for 5.3.12
Size: 9949 Total time isset: 0.001838 Total time in_array: 1.306224
Output for 5.3.11
Size: 9940 Total time isset: 0.002327 Total time in_array: 1.358977
Output for 5.3.10
Size: 9965 Total time isset: 0.002366 Total time in_array: 1.332081
Output for 5.3.9
Size: 9964 Total time isset: 0.001770 Total time in_array: 1.324035