3v4l.org

run code in 200+ 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.2.0
Size: 9956 Total time isset: 0.000562 Total time in_array: 0.123288
Output for 7.1.7
Size: 9942 Total time isset: 0.001058 Total time in_array: 0.126291
Output for 7.1.6
Size: 9953 Total time isset: 0.000840 Total time in_array: 0.129735
Output for 7.1.5
Size: 9948 Total time isset: 0.000956 Total time in_array: 0.126795
Output for 7.1.4
Size: 9945 Total time isset: 0.000855 Total time in_array: 0.125078
Output for 7.1.3
Size: 9959 Total time isset: 0.000841 Total time in_array: 0.122551
Output for 7.1.2
Size: 9959 Total time isset: 0.000960 Total time in_array: 0.129011
Output for 7.1.1
Size: 9950 Total time isset: 0.002105 Total time in_array: 0.176385
Output for 7.1.0
Size: 9947 Total time isset: 0.001939 Total time in_array: 0.173399
Output for 7.0.20
Size: 9956 Total time isset: 0.000831 Total time in_array: 0.123466
Output for 7.0.19
Size: 9949 Total time isset: 0.001503 Total time in_array: 0.164987
Output for 7.0.18
Size: 9944 Total time isset: 0.000873 Total time in_array: 0.129588
Output for 7.0.17
Size: 9955 Total time isset: 0.000714 Total time in_array: 0.117732
Output for 7.0.16
Size: 9958 Total time isset: 0.000855 Total time in_array: 0.134805
Output for 7.0.15
Size: 9945 Total time isset: 0.000935 Total time in_array: 0.119073
Output for 7.0.14
Size: 9951 Total time isset: 0.000726 Total time in_array: 0.128334
Output for 7.0.13
Size: 9934 Total time isset: 0.001064 Total time in_array: 0.138763
Output for 7.0.12
Size: 9955 Total time isset: 0.001565 Total time in_array: 0.158934
Output for 7.0.11
Size: 9931 Total time isset: 0.000851 Total time in_array: 0.127887
Output for 7.0.10
Size: 9957 Total time isset: 0.001523 Total time in_array: 0.137078
Output for 7.0.9
Size: 9937 Total time isset: 0.000942 Total time in_array: 0.128586
Output for 7.0.8
Size: 9943 Total time isset: 0.000810 Total time in_array: 0.138001
Output for 7.0.7
Size: 9954 Total time isset: 0.000717 Total time in_array: 0.125539
Output for 7.0.6
Size: 9943 Total time isset: 0.000737 Total time in_array: 0.128310
Output for 7.0.5
Size: 9951 Total time isset: 0.000767 Total time in_array: 0.117036
Output for 7.0.4
Size: 9955 Total time isset: 0.000937 Total time in_array: 0.139209
Output for 7.0.3
Size: 9946 Total time isset: 0.000784 Total time in_array: 0.127838
Output for 7.0.2
Size: 9952 Total time isset: 0.000760 Total time in_array: 0.115851
Output for 7.0.1
Size: 9959 Total time isset: 0.000807 Total time in_array: 0.119289
Output for 7.0.0
Size: 9941 Total time isset: 0.000750 Total time in_array: 0.118437
Output for hhvm-3.17.3
Size: 9943 Total time isset: 0.001746 Total time in_array: 0.462775
Output for hhvm-3.15.4
Size: 9956 Total time isset: 0.001814 Total time in_array: 0.439540
Output for hhvm-3.13.2
Size: 9954 Total time isset: 0.001627 Total time in_array: 0.906815
Output for hhvm-3.12.14
Size: 9950 Total time isset: 0.001473 Total time in_array: 1.017562
Output for hhvm-3.11.1
Size: 9959 Total time isset: 0.001748 Total time in_array: 0.965977
Output for hhvm-3.10.1
Size: 9949 Total time isset: 0.003851 Total time in_array: 0.827014
Output for 5.6.30
Size: 9947 Total time isset: 0.001433 Total time in_array: 1.092297
Output for 5.6.29
Size: 9958 Total time isset: 0.001461 Total time in_array: 1.095797
Output for 5.6.28
Size: 9959 Total time isset: 0.001647 Total time in_array: 1.267280
Output for 5.6.27
Size: 9954 Total time isset: 0.001532 Total time in_array: 1.256569
Output for 5.6.26
Size: 9947 Total time isset: 0.001597 Total time in_array: 1.160468
Output for 5.6.25
Size: 9948 Total time isset: 0.001357 Total time in_array: 1.207863
Output for 5.6.24
Size: 9950 Total time isset: 0.001844 Total time in_array: 1.243182
Output for 5.6.23
Size: 9946 Total time isset: 0.001662 Total time in_array: 1.430751
Output for 5.6.22
Size: 9951 Total time isset: 0.003276 Total time in_array: 1.400421
Output for 5.6.21
Size: 9948 Total time isset: 0.001957 Total time in_array: 1.420627
Output for 5.6.20
Size: 9952 Total time isset: 0.002345 Total time in_array: 1.156708
Output for 5.6.19
Size: 9948 Total time isset: 0.001383 Total time in_array: 1.136006
Output for 5.6.18
Size: 9948 Total time isset: 0.001814 Total time in_array: 1.334503
Output for 5.6.17
Size: 9950 Total time isset: 0.001443 Total time in_array: 1.152817
Output for 5.6.16
Size: 9953 Total time isset: 0.001390 Total time in_array: 1.104412
Output for 5.6.15
Size: 9963 Total time isset: 0.002048 Total time in_array: 1.176351
Output for 5.6.14
Size: 9950 Total time isset: 0.002781 Total time in_array: 1.065641
Output for 5.6.13
Size: 9954 Total time isset: 0.001382 Total time in_array: 1.052530
Output for 5.6.12
Size: 9950 Total time isset: 0.001453 Total time in_array: 1.127150
Output for 5.6.11
Size: 9950 Total time isset: 0.001528 Total time in_array: 1.119075
Output for 5.6.10
Size: 9961 Total time isset: 0.001365 Total time in_array: 1.158630
Output for 5.6.9
Size: 9951 Total time isset: 0.001919 Total time in_array: 1.402625
Output for 5.6.8
Size: 9940 Total time isset: 0.001813 Total time in_array: 1.307656
Output for 5.6.7
Size: 9954 Total time isset: 0.001335 Total time in_array: 1.152380
Output for 5.6.6
Size: 9955 Total time isset: 0.002252 Total time in_array: 1.289532
Output for 5.6.5
Size: 9951 Total time isset: 0.001376 Total time in_array: 1.103519
Output for 5.6.4
Size: 9953 Total time isset: 0.001502 Total time in_array: 1.136352
Output for 5.6.3
Size: 9956 Total time isset: 0.001375 Total time in_array: 1.087954
Output for 5.6.2
Size: 9952 Total time isset: 0.001551 Total time in_array: 1.105561
Output for 5.6.1
Size: 9948 Total time isset: 0.001703 Total time in_array: 1.259693
Output for 5.6.0
Size: 9954 Total time isset: 0.001335 Total time in_array: 1.093237
Output for 5.5.38
Size: 9961 Total time isset: 0.002726 Total time in_array: 1.188680
Output for 5.5.37
Size: 9940 Total time isset: 0.002113 Total time in_array: 1.135724
Output for 5.5.36
Size: 9947 Total time isset: 0.001838 Total time in_array: 1.181600
Output for 5.5.35
Size: 9952 Total time isset: 0.001606 Total time in_array: 1.104592
Output for 5.5.34
Size: 9953 Total time isset: 0.001390 Total time in_array: 1.442882
Output for 5.5.33
Size: 9954 Total time isset: 0.001534 Total time in_array: 1.405773
Output for 5.5.32
Size: 9951 Total time isset: 0.001400 Total time in_array: 1.432193
Output for 5.5.31
Size: 9953 Total time isset: 0.001366 Total time in_array: 1.440267
Output for 5.5.30
Size: 9962 Total time isset: 0.001811 Total time in_array: 1.509706
Output for 5.5.29
Size: 9952 Total time isset: 0.001479 Total time in_array: 1.401237
Output for 5.5.28
Size: 9936 Total time isset: 0.001573 Total time in_array: 1.606403
Output for 5.5.27
Size: 9936 Total time isset: 0.001470 Total time in_array: 1.398954
Output for 5.5.26
Size: 9946 Total time isset: 0.001938 Total time in_array: 1.385384
Output for 5.5.25
Size: 9936 Total time isset: 0.002971 Total time in_array: 1.499789
Output for 5.5.24
Size: 9954 Total time isset: 0.002997 Total time in_array: 1.491983
Output for 5.5.23
Size: 9957 Total time isset: 0.002301 Total time in_array: 1.427472
Output for 5.5.22
Size: 9951 Total time isset: 0.001452 Total time in_array: 1.422400
Output for 5.5.21
Size: 9945 Total time isset: 0.001448 Total time in_array: 1.357359
Output for 5.5.20
Size: 9943 Total time isset: 0.001452 Total time in_array: 1.362237
Output for 5.5.19
Size: 9954 Total time isset: 0.002342 Total time in_array: 1.420117
Output for 5.5.18
Size: 9943 Total time isset: 0.001875 Total time in_array: 1.358008
Output for 5.5.16
Size: 9961 Total time isset: 0.001761 Total time in_array: 1.372177
Output for 5.5.15
Size: 9955 Total time isset: 0.001475 Total time in_array: 1.382372
Output for 5.5.14
Size: 9952 Total time isset: 0.001510 Total time in_array: 1.375625
Output for 5.5.13
Size: 9950 Total time isset: 0.001719 Total time in_array: 1.433198
Output for 5.5.12
Size: 9954 Total time isset: 0.001423 Total time in_array: 1.406552
Output for 5.5.11
Size: 9940 Total time isset: 0.001413 Total time in_array: 1.433788
Output for 5.5.10
Size: 9949 Total time isset: 0.001647 Total time in_array: 1.412014
Output for 5.5.9
Size: 9946 Total time isset: 0.001551 Total time in_array: 1.552749
Output for 5.5.8
Size: 9959 Total time isset: 0.001598 Total time in_array: 1.434721
Output for 5.5.7
Size: 9954 Total time isset: 0.002990 Total time in_array: 1.447446
Output for 5.5.6
Size: 9943 Total time isset: 0.001773 Total time in_array: 1.509633
Output for 5.5.5
Size: 9953 Total time isset: 0.001459 Total time in_array: 1.407245
Output for 5.5.4
Size: 9959 Total time isset: 0.002288 Total time in_array: 1.439585
Output for 5.5.3
Size: 9942 Total time isset: 0.001798 Total time in_array: 1.435047
Output for 5.5.2
Size: 9955 Total time isset: 0.001407 Total time in_array: 1.451618
Output for 5.5.1
Size: 9951 Total time isset: 0.002384 Total time in_array: 1.475134
Output for 5.5.0
Size: 9959 Total time isset: 0.001468 Total time in_array: 1.374733
Output for 5.4.45
Size: 9941 Total time isset: 0.001433 Total time in_array: 1.359806
Output for 5.4.44
Size: 9939 Total time isset: 0.001786 Total time in_array: 1.340197
Output for 5.4.43
Size: 9950 Total time isset: 0.001620 Total time in_array: 1.367081
Output for 5.4.42
Size: 9946 Total time isset: 0.002177 Total time in_array: 1.398813
Output for 5.4.41
Size: 9957 Total time isset: 0.001362 Total time in_array: 1.400329
Output for 5.4.40
Size: 9953 Total time isset: 0.001325 Total time in_array: 1.370628
Output for 5.4.39
Size: 9946 Total time isset: 0.001541 Total time in_array: 1.322754
Output for 5.4.38
Size: 9946 Total time isset: 0.001498 Total time in_array: 1.385286
Output for 5.4.37
Size: 9954 Total time isset: 0.001845 Total time in_array: 1.332757
Output for 5.4.36
Size: 9957 Total time isset: 0.002257 Total time in_array: 1.354831
Output for 5.4.35
Size: 9953 Total time isset: 0.001810 Total time in_array: 1.385785
Output for 5.4.34
Size: 9956 Total time isset: 0.001387 Total time in_array: 1.391229
Output for 5.4.32
Size: 9956 Total time isset: 0.001335 Total time in_array: 1.286179
Output for 5.4.31
Size: 9938 Total time isset: 0.001361 Total time in_array: 1.290578
Output for 5.4.30
Size: 9935 Total time isset: 0.001426 Total time in_array: 1.348724
Output for 5.4.29
Size: 9941 Total time isset: 0.001385 Total time in_array: 1.314867
Output for 5.4.28
Size: 9948 Total time isset: 0.001488 Total time in_array: 1.426946
Output for 5.4.27
Size: 9949 Total time isset: 0.001971 Total time in_array: 1.348278
Output for 5.4.26
Size: 9953 Total time isset: 0.001367 Total time in_array: 1.304868
Output for 5.4.25
Size: 9953 Total time isset: 0.001736 Total time in_array: 1.404316
Output for 5.4.24
Size: 9956 Total time isset: 0.002590 Total time in_array: 1.401304
Output for 5.4.23
Size: 9949 Total time isset: 0.001401 Total time in_array: 1.305261
Output for 5.4.22
Size: 9941 Total time isset: 0.001444 Total time in_array: 1.405675
Output for 5.4.21
Size: 9949 Total time isset: 0.001783 Total time in_array: 1.389817
Output for 5.4.20
Size: 9956 Total time isset: 0.001402 Total time in_array: 1.311045
Output for 5.4.19
Size: 9956 Total time isset: 0.001752 Total time in_array: 1.368625
Output for 5.4.18
Size: 9952 Total time isset: 0.001697 Total time in_array: 1.340542
Output for 5.4.17
Size: 9960 Total time isset: 0.002961 Total time in_array: 1.310379
Output for 5.4.16
Size: 9944 Total time isset: 0.001370 Total time in_array: 1.398983
Output for 5.4.15
Size: 9959 Total time isset: 0.001347 Total time in_array: 1.319228
Output for 5.4.14
Size: 9949 Total time isset: 0.002629 Total time in_array: 1.408963
Output for 5.4.13
Size: 9951 Total time isset: 0.001569 Total time in_array: 1.462136
Output for 5.4.12
Size: 9946 Total time isset: 0.001393 Total time in_array: 1.378433
Output for 5.4.11
Size: 9950 Total time isset: 0.001452 Total time in_array: 1.357829
Output for 5.4.10
Size: 9952 Total time isset: 0.001896 Total time in_array: 1.359376
Output for 5.4.9
Size: 9942 Total time isset: 0.001402 Total time in_array: 1.381584
Output for 5.4.8
Size: 9948 Total time isset: 0.001618 Total time in_array: 1.371561
Output for 5.4.7
Size: 9963 Total time isset: 0.001499 Total time in_array: 1.433160
Output for 5.4.6
Size: 9960 Total time isset: 0.001791 Total time in_array: 1.364842
Output for 5.4.5
Size: 9955 Total time isset: 0.001881 Total time in_array: 1.413526
Output for 5.4.4
Size: 9951 Total time isset: 0.001542 Total time in_array: 1.376720
Output for 5.4.3
Size: 9957 Total time isset: 0.001391 Total time in_array: 1.335886
Output for 5.4.2
Size: 9937 Total time isset: 0.001598 Total time in_array: 1.345751
Output for 5.4.1
Size: 9952 Total time isset: 0.001603 Total time in_array: 1.334826
Output for 5.4.0
Size: 9952 Total time isset: 0.001378 Total time in_array: 1.347577