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: ", 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: ", number_format($total_time, 6), PHP_EOL;
Output for 7.1.0
Size: 9949 Total time: -0.000001 Total time: 0.000002
Output for 7.0.14
Size: 9954 Total time: 0.001308 Total time: -0.143445
Output for 7.0.13
Size: 9954 Total time: 0.001452 Total time: 0.190389
Output for 7.0.12
Size: 9963 Total time: 0.001199 Total time: 0.177820
Output for 7.0.11
Size: 9950 Total time: 0.001248 Total time: 0.190064
Output for 7.0.10
Size: 9950 Total time: 0.001049 Total time: 0.180364
Output for 7.0.9
Size: 9951 Total time: 0.001096 Total time: 0.184526
Output for 7.0.8
Size: 9948 Total time: 0.001416 Total time: 0.229107
Output for 7.0.7
Size: 9950 Total time: 0.001525 Total time: 0.195776
Output for 7.0.6
Size: 9955 Total time: 0.001271 Total time: 0.190293
Output for 7.0.5
Size: 9960 Total time: 0.001110 Total time: 0.187461
Output for 7.0.4
Size: 9949 Total time: 0.002070 Total time: 0.030332
Output for 7.0.3
Size: 9934 Total time: 0.002562 Total time: 0.120378
Output for 7.0.2
Size: 9956 Total time: 0.001242 Total time: 0.156207
Output for 7.0.1
Size: 9940 Total time: 0.001432 Total time: 0.190854
Output for 7.0.0
Size: 9947 Total time: 0.001642 Total time: 0.185213
Output for hhvm-3.13.2
Size: 9951 Total time: 0.000000 Total time: 1.000001
Output for hhvm-3.12.0
Size: 9958 Total time: 0.000000 Total time: 1.000002
Output for hhvm-3.10.0
Size: 9943 Total time: -0.000001 Total time: 1.000003
Output for 5.6.28
Size: 9948 Total time: 0.002339 Total time: 1.087585
Output for 5.6.27
Size: 9940 Total time: 0.002315 Total time: 0.633647
Output for 5.6.26
Size: 9946 Total time: 0.002307 Total time: 1.223217
Output for 5.6.25
Size: 9952 Total time: 0.002724 Total time: 1.316362
Output for 5.6.24
Size: 9936 Total time: 0.002679 Total time: 1.058650
Output for 5.6.23
Size: 9951 Total time: 0.005461 Total time: 1.292720
Output for 5.6.22
Size: 9937 Total time: 0.003996 Total time: 1.994219
Output for 5.6.21
Size: 9948 Total time: 0.003515 Total time: 2.405981
Output for 5.6.20
Size: 9958 Total time: 0.002850 Total time: 1.514056
Output for 5.6.19
Size: 9962 Total time: 0.003066 Total time: 2.066600
Output for 5.6.18
Size: 9953 Total time: 0.004327 Total time: 1.805500
Output for 5.6.17
Size: 9955 Total time: 0.002710 Total time: 1.597595
Output for 5.6.16
Size: 9955 Total time: 0.002842 Total time: 1.065563
Output for 5.6.15
Size: 9935 Total time: 0.002618 Total time: 1.511895
Output for 5.6.14
Size: 9938 Total time: 0.003506 Total time: 1.011405
Output for 5.6.13
Size: 9949 Total time: 0.002868 Total time: 1.604886
Output for 5.6.12
Size: 9948 Total time: 0.002899 Total time: 1.122864
Output for 5.6.11
Size: 9941 Total time: 0.005114 Total time: 1.518367
Output for 5.6.10
Size: 9963 Total time: 0.002260 Total time: 1.040547
Output for 5.6.9
Size: 9946 Total time: 0.002958 Total time: 1.474454
Output for 5.6.8
Size: 9950 Total time: 0.002646 Total time: 0.865211
Output for 5.6.7
Size: 9952 Total time: 0.005127 Total time: 1.719661
Output for 5.6.6
Size: 9951 Total time: 0.002755 Total time: 1.376611
Output for 5.6.5
Size: 9950 Total time: 0.005180 Total time: 0.483940
Output for 5.6.4
Size: 9947 Total time: 0.002232 Total time: 1.308796
Output for 5.6.3
Size: 9940 Total time: 0.003059 Total time: 0.495861
Output for 5.6.2
Size: 9955 Total time: 0.002324 Total time: 1.549237
Output for 5.6.1
Size: 9961 Total time: 0.004108 Total time: 1.726743
Output for 5.6.0
Size: 9952 Total time: 0.007071 Total time: 1.458849
Output for 5.5.38
Size: 9939 Total time: 0.002517 Total time: 1.383952
Output for 5.5.37
Size: 9946 Total time: 0.002271 Total time: 0.562929
Output for 5.5.36
Size: 9944 Total time: 0.003198 Total time: 0.890317
Output for 5.5.35
Size: 9949 Total time: 0.002867 Total time: 1.552862
Output for 5.5.34
Size: 9952 Total time: 0.004522 Total time: 2.070975
Output for 5.5.33
Size: 9954 Total time: 0.002421 Total time: 1.259298
Output for 5.5.32
Size: 9963 Total time: 0.002503 Total time: 1.995703
Output for 5.5.31
Size: 9954 Total time: 0.002876 Total time: 0.458686
Output for 5.5.30
Size: 9957 Total time: 0.002928 Total time: 2.030539
Output for 5.5.29
Size: 9950 Total time: 0.002941 Total time: 1.886081
Output for 5.5.28
Size: 9953 Total time: 0.002360 Total time: 1.612116
Output for 5.5.27
Size: 9944 Total time: 0.002360 Total time: 0.651569
Output for 5.5.26
Size: 9945 Total time: 0.002742 Total time: 0.484473
Output for 5.5.25
Size: 9962 Total time: 0.004747 Total time: 1.245564
Output for 5.5.24
Size: 9950 Total time: 0.004217 Total time: 0.360206
Output for 5.5.23
Size: 9945 Total time: 0.002833 Total time: 1.854450
Output for 5.5.22
Size: 9946 Total time: 0.002731 Total time: 0.905649
Output for 5.5.21
Size: 9963 Total time: 0.002905 Total time: 0.935533
Output for 5.5.20
Size: 9952 Total time: 0.002352 Total time: 1.835499
Output for 5.5.19
Size: 9952 Total time: 0.005292 Total time: 1.845830
Output for 5.5.18
Size: 9946 Total time: 0.002951 Total time: 1.919469
Output for 5.5.16
Size: 9936 Total time: 0.003519 Total time: 1.714389
Output for 5.5.15
Size: 9949 Total time: 0.003238 Total time: 2.018914
Output for 5.5.14
Size: 9946 Total time: 0.002723 Total time: 1.873811
Output for 5.5.13
Size: 9954 Total time: 0.002922 Total time: 1.884253
Output for 5.5.12
Size: 9942 Total time: 0.002377 Total time: 2.059342
Output for 5.5.11
Size: 9960 Total time: 0.004298 Total time: 2.075845
Output for 5.5.10
Size: 9955 Total time: 0.005350 Total time: 0.127024
Output for 5.5.9
Size: 9945 Total time: 0.003713 Total time: 1.852343
Output for 5.5.8
Size: 9959 Total time: 0.002867 Total time: 1.602172
Output for 5.5.7
Size: 9951 Total time: 0.002817 Total time: 1.562480
Output for 5.5.6
Size: 9949 Total time: 0.003884 Total time: 1.950408
Output for 5.5.5
Size: 9939 Total time: 0.006059
Process exited with code 137.
Output for 5.5.4
Size: 9949 Total time: 0.003148 Total time: 2.220543
Output for 5.5.3
Size: 9959 Total time: 0.003862 Total time: 2.011500
Output for 5.5.2
Size: 9953 Total time: 0.004132 Total time: 2.067983
Output for 5.5.1
Size: 9954 Total time: 0.004479 Total time: 2.053853
Output for 5.5.0
Size: 9943 Total time: 0.006086
Process exited with code 137.
Output for 5.4.45
Size: 9949 Total time: 0.002226 Total time: 0.558043
Output for 5.4.44
Size: 9947 Total time: -0.019969 Total time: 1.813009
Output for 5.4.43
Size: 9941 Total time: 0.002252 Total time: 1.635633
Output for 5.4.42
Size: 9948 Total time: 0.004473 Total time: 1.471925
Output for 5.4.41
Size: 9956 Total time: 0.005011 Total time: 1.309929
Output for 5.4.40
Size: 9961 Total time: 0.002839 Total time: 0.293229
Output for 5.4.39
Size: 9947 Total time: 0.005271 Total time: 1.833399
Output for 5.4.38
Size: 9933 Total time: 0.004128 Total time: 1.835481
Output for 5.4.37
Size: 9955 Total time: 0.002914 Total time: 0.887044
Output for 5.4.36
Size: 9937 Total time: 0.003824 Total time: 1.822919
Output for 5.4.35
Size: 9959 Total time: 0.003175 Total time: 0.903420
Output for 5.4.34
Size: 9946 Total time: 0.002820 Total time: 2.236961
Output for 5.4.32
Size: 9948 Total time: 0.002383 Total time: 0.153505
Output for 5.4.31
Size: 9956 Total time: 0.004137 Total time: 1.766555
Output for 5.4.30
Size: 9943 Total time: 0.002976 Total time: 1.815257
Output for 5.4.29
Size: 9949 Total time: 0.004960 Total time: 1.737902
Output for 5.4.28
Size: 9950 Total time: 0.004946 Total time: 2.255521
Output for 5.4.27
Size: 9952 Total time: 0.003387 Total time: 2.082522
Output for 5.4.26
Size: 9954 Total time: 0.002848 Total time: 1.879539
Output for 5.4.25
Size: 9956 Total time: 0.002939 Total time: 1.793676
Output for 5.4.24
Size: 9959 Total time: 0.002787 Total time: 1.700700
Output for 5.4.23
Size: 9961 Total time: 0.002953 Total time: 1.581655
Output for 5.4.22
Size: 9956 Total time: 0.002340 Total time: 2.032009
Output for 5.4.21
Size: 9942 Total time: 0.002654 Total time: 2.052116
Output for 5.4.20
Size: 9947 Total time: 0.002754 Total time: 1.995925
Output for 5.4.19
Size: 9944 Total time: 0.003674 Total time: 0.944562
Output for 5.4.18
Size: 9954 Total time: 0.004036 Total time: 2.053263
Output for 5.4.17
Size: 9959 Total time: 0.004258
Process exited with code 137.
Output for 5.4.16
Size: 9951 Total time: 0.002706 Total time: 2.038673
Output for 5.4.15
Size: 9946 Total time: 0.005846 Total time: 2.226748
Output for 5.4.14
Size: 9939 Total time: 0.002654 Total time: 2.081300
Output for 5.4.13
Size: 9956 Total time: 0.003279 Total time: 0.602461
Output for 5.4.12
Size: 9957 Total time: 0.002205 Total time: 0.387185
Output for 5.4.11
Size: 9951 Total time: 0.002987 Total time: 1.199633
Output for 5.4.10
Size: 9956 Total time: 0.004899 Total time: 1.806093
Output for 5.4.9
Size: 9954 Total time: 0.005182 Total time: 1.953951
Output for 5.4.8
Size: 9952 Total time: 0.005772
Process exited with code 137.
Output for 5.4.7
Size: 9950 Total time: 0.004118 Total time: 2.060973
Output for 5.4.6
Size: 9945 Total time: 0.005323 Total time: 0.545959
Output for 5.4.5
Size: 9951 Total time: 0.002344 Total time: 0.593051
Output for 5.4.4
Size: 9939 Total time: 0.002932 Total time: 0.243724
Output for 5.4.3
Size: 9963 Total time: 0.002428 Total time: 1.797187
Output for 5.4.2
Size: 9957 Total time: 0.002297 Total time: 1.391655
Output for 5.4.1
Size: 9951 Total time: 0.002744 Total time: 1.137663
Output for 5.4.0
Size: 9946 Total time: 0.002763 Total time: 0.903920
Output for 5.3.29
Size: 9945 Total time: 0.003337 Total time: 0.117488
Output for 5.3.28
Size: 9958 Total time: 0.003064 Total time: 1.587325
Output for 5.3.27
Size: 9961 Total time: 0.003176
Process exited with code 137.
Output for 5.3.26
Size: 9959 Total time: 0.003256
Process exited with code 137.
Output for 5.3.25
Size: 9956 Total time: 0.006305 Total time: 2.158644
Output for 5.3.24
Size: 9945 Total time: 0.002716 Total time: 2.034607
Output for 5.3.23
Size: 9953 Total time: 0.002954 Total time: 0.521019
Output for 5.3.22
Size: 9951 Total time: 0.004509 Total time: 0.588431
Output for 5.3.21
Size: 9960 Total time: 0.004276 Total time: 2.087240
Output for 5.3.20
Size: 9936 Total time: 0.003006 Total time: 2.138742
Output for 5.3.19
Size: 9951 Total time: 0.002592 Total time: 2.356681
Output for 5.3.18
Size: 9963 Total time: 0.003872
Process exited with code 137.
Output for 5.3.17
Size: 9955 Total time: 0.004664 Total time: 1.669035
Output for 5.3.16
Size: 9960 Total time: 0.002562 Total time: 0.586789
Output for 5.3.15
Size: 9948 Total time: 0.003391 Total time: 0.650397
Output for 5.3.14
Size: 9947 Total time: 0.003137 Total time: 0.441228
Output for 5.3.13
Size: 9953 Total time: 0.003226 Total time: 1.767120
Output for 5.3.12
Size: 9953 Total time: 0.003174 Total time: 1.629161
Output for 5.3.11
Size: 9960 Total time: 0.003708 Total time: 1.291174
Output for 5.3.10
Size: 9942 Total time: 0.003482 Total time: 1.996646
Output for 5.3.9
Size: 9948 Total time: 0.002771 Total time: 2.026711
Output for 5.3.8
Size: 9958 Total time: 0.006163 Total time: 2.139508
Output for 5.3.7
Size: 9941 Total time: 0.002971 Total time: 1.635228
Output for 5.3.6
Size: 9948 Total time: 0.003317 Total time: 1.484351
Output for 5.3.5
Size: 9943 Total time: 0.003671 Total time: 1.375350
Output for 5.3.4
Size: 9953 Total time: 0.003131 Total time: 1.354421
Output for 5.3.3
Size: 9949 Total time: 0.003430 Total time: 1.364170
Output for 5.3.2
Size: 9957 Total time: 0.005020 Total time: 1.516577
Output for 5.3.1
Size: 9961 Total time: 0.003981 Total time: 1.646995
Output for 5.3.0
Size: 9946 Total time: 0.003231 Total time: 1.640215