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: ", 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;

Abusive script

This script was stopped while abusing our resources

Output for 7.1.9
Size: 9952 Total time: 0.001324 Total time: 0.208743
Output for 7.1.8
Size: 9943 Total time: 0.001356 Total time: 0.210677
Output for 7.1.7
Size: 9952 Total time: 0.001456 Total time: 0.211167
Output for 7.1.6
Size: 9938 Total time: 0.001718 Total time: 0.204515
Output for 7.1.5
Size: 9947 Total time: 0.001209 Total time: 0.229575
Output for 7.1.4
Size: 9946 Total time: 0.001392 Total time: 0.334003
Output for 7.1.3
Size: 9939 Total time: 0.001311 Total time: 0.215883
Output for 7.1.2
Size: 9943 Total time: 0.001214 Total time: 0.220099
Output for 7.1.1
Size: 9945 Total time: 0.001283 Total time: 0.221643
Output for 7.1.0
Size: 9940 Total time: 0.001247 Total time: 0.211540
Output for 7.0.23
Size: 9947 Total time: 0.001220 Total time: 0.228044
Output for 7.0.22
Size: 9960 Total time: 0.001276 Total time: 0.209415
Output for 7.0.21
Size: 9937 Total time: 0.001832 Total time: 0.250079
Output for 7.0.20
Size: 9945 Total time: 0.001179 Total time: 0.216667
Output for 7.0.19
Size: 9952 Total time: 0.001881 Total time: 0.234238
Output for 7.0.18
Size: 9940 Total time: 0.001116 Total time: 0.293329
Output for 7.0.17
Size: 9947 Total time: 0.001181 Total time: 0.205323
Output for 7.0.16
Size: 9957 Total time: 0.001152 Total time: 0.224701
Output for 7.0.15
Size: 9959 Total time: 0.001188 Total time: 0.202516
Output for 7.0.14
Size: 9950 Total time: 0.001071 Total time: 0.205621
Output for 7.0.13
Size: 9945 Total time: 0.001152 Total time: 0.203332
Output for 7.0.12
Size: 9951 Total time: 0.001201 Total time: 0.199097
Output for 7.0.11
Size: 9963 Total time: 0.001578 Total time: 0.201455
Output for 7.0.10
Size: 9964 Total time: 0.001171 Total time: 0.219496
Output for 7.0.9
Size: 9962 Total time: 0.001154 Total time: 0.248171
Output for 7.0.8
Size: 9954 Total time: 0.001109 Total time: 0.236117
Output for 7.0.7
Size: 9951 Total time: 0.001266 Total time: 0.234866
Output for 7.0.6
Size: 9947 Total time: 0.001854 Total time: 0.240302
Output for 7.0.5
Size: 9948 Total time: 0.001413 Total time: 0.208643
Output for 7.0.4
Size: 9955 Total time: 0.001476 Total time: 0.206044
Output for 7.0.3
Size: 9955 Total time: 0.001073 Total time: 0.206761
Output for 7.0.2
Size: 9943 Total time: 0.001852 Total time: 0.213187
Output for 7.0.1
Size: 9958 Total time: 0.001255 Total time: 0.270592
Output for 7.0.0
Size: 9948 Total time: 0.003316 Total time: 0.220421
Output for hhvm-3.21.0
Size: 9953 Total time: 0.002799 Total time: 0.695223
Output for hhvm-3.20.2
Size: 9949 Total time: 0.003540 Total time: 0.699147
Output for hhvm-3.19.2
Size: 9947 Total time: 0.002693 Total time: 0.698959
Output for hhvm-3.18.4
Size: 9937 Total time: 0.002433 Total time: 0.701577
Output for hhvm-3.17.3
Size: 9942 Total time: 0.001974 Total time: 0.701781
Output for hhvm-3.15.4
Size: 9947 Total time: 0.002120 Total time: 0.622246
Output for hhvm-3.13.2
Size: 9951 Total time: 0.003209 Total time: 1.218122
Output for hhvm-3.12.14
Size: 9956 Total time: 0.003297 Total time: 1.344051
Output for hhvm-3.11.1
Size: 9943 Total time: 0.005342 Total time: 1.344611
Output for hhvm-3.10.1
Size: 9949 Total time: 0.002637 Total time: 1.364822
Output for 5.6.30
Size: 9955 Total time: 0.002641 Total time: 1.615329
Output for 5.6.29
Size: 9962 Total time: 0.002928 Total time: 1.635374
Output for 5.6.28
Size: 9946 Total time: 0.002938 Total time: 1.771470
Output for 5.6.27
Size: 9951 Total time: 0.002559 Total time: 1.671668
Output for 5.6.26
Size: 9955 Total time: 0.002609 Total time: 1.706129
Output for 5.6.25
Size: 9967 Total time: 0.002882 Total time: 1.689936
Output for 5.6.24
Size: 9940 Total time: 0.002885 Total time: 1.805047
Output for 5.6.23
Size: 9961 Total time: 0.003152 Total time: 1.716069
Output for 5.6.22
Size: 9948 Total time: 0.002219 Total time: 1.635540
Output for 5.6.21
Size: 9956 Total time: 0.002430 Total time: 2.015374
Output for 5.6.20
Size: 9952 Total time: 0.003323 Total time: 1.703678
Output for 5.6.19
Size: 9942 Total time: 0.002833 Total time: 1.671480
Output for 5.6.18
Size: 9959 Total time: 0.003133 Total time: 1.673429
Output for 5.6.17
Size: 9950 Total time: 0.002374 Total time: 1.628540
Output for 5.6.16
Size: 9957 Total time: 0.002923 Total time: 1.765262
Output for 5.6.15
Size: 9956 Total time: 0.004243 Total time: 1.643490
Output for 5.6.14
Size: 9943 Total time: 0.002866 Total time: 1.868892
Output for 5.6.13
Size: 9962 Total time: 0.003132 Total time: 1.774426
Output for 5.6.12
Size: 9953 Total time: 0.002283 Total time: 1.768179
Output for 5.6.11
Size: 9959 Total time: 0.002212 Total time: 1.746894
Output for 5.6.10
Size: 9950 Total time: 0.002832 Total time: 2.024205
Output for 5.6.9
Size: 9954 Total time: 0.003203 Total time: 1.724540
Output for 5.6.8
Size: 9948 Total time: 0.002343 Total time: 1.950961
Output for 5.6.7
Size: 9938 Total time: 0.004772 Total time: 1.788021
Output for 5.6.6
Size: 9948 Total time: 0.002537 Total time: 1.833049
Output for 5.6.5
Size: 9947 Total time: 0.002428 Total time: 1.736018
Output for 5.6.4
Size: 9950 Total time: 0.002508
Process exited with code 137.
Output for 5.6.3
Size: 9946 Total time: 0.005306 Total time: 2.292700
Output for 5.6.2
Size: 9955 Total time: 0.003254 Total time: 1.740066
Output for 5.6.1
Size: 9954 Total time: 0.002843 Total time: 1.672733
Output for 5.6.0
Size: 9962 Total time: 0.002292 Total time: 1.887324
Output for 5.5.38
Size: 9949 Total time: 0.002841 Total time: 1.789508
Output for 5.5.37
Size: 9950 Total time: 0.002467 Total time: 1.701221
Output for 5.5.36
Size: 9958 Total time: 0.002816 Total time: 1.599579
Output for 5.5.35
Size: 9953 Total time: 0.002433 Total time: 1.672682
Output for 5.5.34
Size: 9952 Total time: 0.002763 Total time: 1.970636
Output for 5.5.33
Size: 9946 Total time: 0.002457 Total time: 1.970153
Output for 5.5.32
Size: 9945 Total time: 0.003201 Total time: 2.032285
Output for 5.5.31
Size: 9961 Total time: 0.006753 Total time: 2.014799
Output for 5.5.30
Size: 9957 Total time: 0.003190 Total time: 2.016259
Output for 5.5.29
Size: 9943 Total time: 0.004220 Total time: 1.994523
Output for 5.5.28
Size: 9950 Total time: 0.004439 Total time: 1.964914
Output for 5.5.27
Size: 9957 Total time: 0.002938 Total time: 2.214235
Output for 5.5.26
Size: 9960 Total time: 0.002509 Total time: 2.102155
Output for 5.5.25
Size: 9955 Total time: 0.003290 Total time: 1.992879
Output for 5.5.24
Size: 9956 Total time: 0.003416 Total time: 2.074891
Output for 5.5.23
Size: 9961 Total time: 0.002964 Total time: 2.206462
Output for 5.5.22
Size: 9952 Total time: 0.003264 Total time: 2.074813
Output for 5.5.21
Size: 9954 Total time: 0.002536 Total time: 2.158167
Output for 5.5.20
Size: 9937 Total time: 0.003334
Process exited with code 137.
Output for 5.5.19
Size: 9936 Total time: 0.003901 Total time: 2.257982
Output for 5.5.18
Size: 9947 Total time: 0.005338 Total time: 2.025374
Output for 5.5.16
Size: 9948 Total time: 0.004104 Total time: 2.107137
Output for 5.5.15
Size: 9958 Total time: 0.004236 Total time: 2.142035
Output for 5.5.14
Size: 9951 Total time: 0.002453 Total time: 1.931414
Output for 5.5.13
Size: 9946 Total time: 0.004374 Total time: 2.051545
Output for 5.5.12
Size: 9954 Total time: 0.005506 Total time: 2.017400
Output for 5.5.11
Size: 9955 Total time: 0.002369 Total time: 2.121940
Output for 5.5.10
Size: 9959 Total time: 0.003802 Total time: 2.009623
Output for 5.5.9
Size: 9956 Total time: 0.003680 Total time: 2.004842
Output for 5.5.8
Size: 9946 Total time: 0.003898 Total time: 2.061315
Output for 5.5.7
Size: 9954 Total time: 0.003188 Total time: 1.979886
Output for 5.5.6
Size: 9953 Total time: 0.002379 Total time: 1.961484
Output for 5.5.5
Size: 9963 Total time: 0.004079 Total time: 1.990967
Output for 5.5.4
Size: 9953 Total time: 0.002469 Total time: 2.054218
Output for 5.5.3
Size: 9948 Total time: 0.002398 Total time: 1.962714
Output for 5.5.2
Size: 9954 Total time: 0.002632 Total time: 2.081473
Output for 5.5.1
Size: 9948 Total time: 0.002550 Total time: 2.112901
Output for 5.5.0
Size: 9953 Total time: 0.003201 Total time: 1.976727
Output for 5.4.45
Size: 9940 Total time: 0.002674 Total time: 1.968572
Output for 5.4.44
Size: 9948 Total time: 0.003061 Total time: 1.917579
Output for 5.4.43
Size: 9952 Total time: 0.002493 Total time: 1.821621
Output for 5.4.42
Size: 9949 Total time: 0.002329 Total time: 1.961073
Output for 5.4.41
Size: 9947 Total time: 0.005309 Total time: 1.925982
Output for 5.4.40
Size: 9947 Total time: 0.002353 Total time: 1.860209
Output for 5.4.39
Size: 9954 Total time: 0.002919 Total time: 1.838035
Output for 5.4.38
Size: 9949 Total time: 0.002295 Total time: 2.097153
Output for 5.4.37
Size: 9949 Total time: 0.002430 Total time: 1.912253
Output for 5.4.36
Size: 9951 Total time: 0.004737
Process exited with code 137.
Output for 5.4.35
Size: 9960 Total time: 0.003998 Total time: 2.060645
Output for 5.4.34
Size: 9940 Total time: 0.002690 Total time: 1.937877
Output for 5.4.32
Size: 9952 Total time: 0.002705 Total time: 1.934595
Output for 5.4.31
Size: 9941 Total time: 0.004255 Total time: 2.131430
Output for 5.4.30
Size: 9957 Total time: 0.002451 Total time: 1.986276
Output for 5.4.29
Size: 9950 Total time: 0.003025 Total time: 2.160833
Output for 5.4.28
Size: 9937 Total time: 0.002367 Total time: 1.916863
Output for 5.4.27
Size: 9943 Total time: 0.002777 Total time: 1.874781
Output for 5.4.26
Size: 9959 Total time: 0.002285 Total time: 1.933089
Output for 5.4.25
Size: 9946 Total time: 0.002912 Total time: 1.908263
Output for 5.4.24
Size: 9944 Total time: 0.003418 Total time: 1.939220
Output for 5.4.23
Size: 9949 Total time: 0.002382 Total time: 1.900352
Output for 5.4.22
Size: 9954 Total time: 0.003136 Total time: 1.879507
Output for 5.4.21
Size: 9938 Total time: 0.002973 Total time: 2.057399
Output for 5.4.20
Size: 9946 Total time: 0.002810 Total time: 1.873896
Output for 5.4.19
Size: 9966 Total time: 0.002899 Total time: 1.991997
Output for 5.4.18
Size: 9954 Total time: 0.003048 Total time: 2.007837
Output for 5.4.17
Size: 9950 Total time: 0.003169 Total time: 1.999578
Output for 5.4.16
Size: 9948 Total time: 0.002576 Total time: 1.866994
Output for 5.4.15
Size: 9949 Total time: 0.002934 Total time: 1.995090
Output for 5.4.14
Size: 9948 Total time: 0.002778 Total time: 1.944139
Output for 5.4.13
Size: 9945 Total time: 0.002442 Total time: 2.055199
Output for 5.4.12
Size: 9951 Total time: 0.003554 Total time: 2.029995
Output for 5.4.11
Size: 9939 Total time: 0.003197 Total time: 2.104544
Output for 5.4.10
Size: 9947 Total time: 0.004011 Total time: 2.014052
Output for 5.4.9
Size: 9945 Total time: 0.003213 Total time: 2.056724
Output for 5.4.8
Size: 9944 Total time: 0.002795 Total time: 1.945028
Output for 5.4.7
Size: 9953 Total time: 0.002620 Total time: 1.816023
Output for 5.4.6
Size: 9941 Total time: 0.005462 Total time: 1.905106
Output for 5.4.5
Size: 9945 Total time: 0.005173 Total time: 2.057489
Output for 5.4.4
Size: 9949 Total time: 0.003275 Total time: 2.124101
Output for 5.4.3
Size: 9931 Total time: 0.002770 Total time: 1.944017
Output for 5.4.2
Size: 9944 Total time: 0.002577 Total time: 1.839660
Output for 5.4.1
Size: 9950 Total time: 0.002234 Total time: 2.151545
Output for 5.4.0
Size: 9957 Total time: 0.002957 Total time: 2.031072
Output for 5.3.29
Size: 9958 Total time: 0.003296 Total time: 2.106999
Output for 5.3.28
Size: 9947 Total time: 0.002620 Total time: 1.887530
Output for 5.3.27
Size: 9953 Total time: 0.003560 Total time: 2.301668
Output for 5.3.26
Size: 9961 Total time: 0.004141 Total time: 2.118066
Output for 5.3.25
Size: 9944 Total time: 0.002808 Total time: 1.874463
Output for 5.3.24
Size: 9953 Total time: 0.003422 Total time: 1.880589
Output for 5.3.23
Size: 9950 Total time: 0.005906 Total time: 2.081936
Output for 5.3.22
Size: 9949 Total time: 0.003943 Total time: 2.164312
Output for 5.3.21
Size: 9940 Total time: 0.003553 Total time: 2.082677
Output for 5.3.20
Size: 9944 Total time: 0.002751 Total time: 1.952859
Output for 5.3.19
Size: 9948 Total time: 0.004448 Total time: 2.095601
Output for 5.3.18
Size: 9956 Total time: 0.004738 Total time: 1.919398
Output for 5.3.17
Size: 9950 Total time: 0.003260 Total time: 1.855346
Output for 5.3.16
Size: 9947 Total time: 0.005940 Total time: 2.139949
Output for 5.3.15
Size: 9953 Total time: 0.004525 Total time: 2.311487
Output for 5.3.14
Size: 9944 Total time: 0.003826 Total time: 1.999420
Output for 5.3.13
Size: 9953 Total time: 0.002938 Total time: 1.948279
Output for 5.3.12
Size: 9958 Total time: 0.003359 Total time: 2.025009
Output for 5.3.11
Size: 9957 Total time: 0.002776 Total time: 2.125271
Output for 5.3.10
Size: 9955 Total time: 0.003109 Total time: 1.868567
Output for 5.3.9
Size: 9948 Total time: 0.003643 Total time: 1.923954
Output for 5.3.8
Size: 9962 Total time: 0.003327 Total time: 1.881341
Output for 5.3.7
Size: 9942 Total time: 0.002856 Total time: 1.873282
Output for 5.3.6
Size: 9953 Total time: 0.002876 Total time: 1.921672
Output for 5.3.5
Size: 9949 Total time: 0.002965 Total time: 2.003303
Output for 5.3.4
Size: 9954 Total time: 0.003650 Total time: 1.945821
Output for 5.3.3
Size: 9953 Total time: 0.002938 Total time: 1.973302
Output for 5.3.2
Size: 9953 Total time: 0.002963 Total time: 2.023437
Output for 5.3.1
Size: 9949 Total time: 0.004569 Total time: 1.882736
Output for 5.3.0
Size: 9949 Total time: 0.002820 Total time: 1.869972