3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array(); for ($i = 0; $i < 1000; ++$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 < 1000; ++$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: 999 Total time: 0.001020 Total time: 0.001687
Output for 7.0.14
Size: 1000 Total time: 0.001314 Total time: 0.001987
Output for 7.0.6
Size: 1000 Total time: 0.001064 Total time: 0.001543
Output for 7.0.5
Size: 1000 Total time: 0.001165 Total time: 0.001728
Output for 7.0.4
Size: 1000 Total time: 0.000706 Total time: 0.001076
Output for 7.0.3
Size: 999 Total time: 0.001978 Total time: 0.002903
Output for 7.0.2
Size: 999 Total time: 0.000726 Total time: 0.001097
Output for 7.0.1
Size: 999 Total time: 0.001122 Total time: 0.001503
Output for 7.0.0
Size: 1000 Total time: 0.001099 Total time: 0.001465
Output for 5.6.28
Size: 1000 Total time: 0.002599 Total time: 0.018744
Output for 5.6.21
Size: 998 Total time: 0.002112 Total time: 0.020071
Output for 5.6.20
Size: 1000 Total time: 0.002009 Total time: 0.019798
Output for 5.6.19
Size: 1000 Total time: 0.001382 Total time: 0.014132
Output for 5.6.18
Size: 999 Total time: 0.001773 Total time: 0.016720
Output for 5.6.17
Size: 1000 Total time: 0.002072 Total time: 0.020284
Output for 5.6.16
Size: 998 Total time: 0.002104 Total time: 0.021217
Output for 5.6.15
Size: 999 Total time: 0.002082 Total time: 0.019874
Output for 5.6.14
Size: 1000 Total time: 0.002084 Total time: 0.020723
Output for 5.6.13
Size: 1000 Total time: 0.001841 Total time: 0.019089
Output for 5.6.12
Size: 999 Total time: 0.001281 Total time: 0.013678
Output for 5.6.11
Size: 999 Total time: 0.001342 Total time: 0.014129
Output for 5.6.10
Size: 1000 Total time: 0.001689 Total time: 0.015642
Output for 5.6.9
Size: 1000 Total time: 0.001913 Total time: 0.019932
Output for 5.6.8
Size: 1000 Total time: 0.002110 Total time: 0.018671
Output for 5.5.35
Size: 999 Total time: 0.002079 Total time: 0.020319
Output for 5.5.34
Size: 997 Total time: 0.001619 Total time: 0.014033
Output for 5.5.33
Size: 1000 Total time: 0.001984 Total time: 0.017190
Output for 5.5.32
Size: 998 Total time: 0.001783 Total time: 0.017632
Output for 5.5.31
Size: 1000 Total time: 0.002376 Total time: 0.018896
Output for 5.5.30
Size: 1000 Total time: 0.001473 Total time: 0.014443
Output for 5.5.29
Size: 1000 Total time: 0.002179 Total time: 0.023070
Output for 5.5.28
Size: 997 Total time: 0.002223 Total time: 0.017771
Output for 5.5.27
Size: 1000 Total time: 0.001872 Total time: 0.017420
Output for 5.5.26
Size: 1000 Total time: 0.001517 Total time: 0.014092
Output for 5.5.25
Size: 1000 Total time: 0.001374 Total time: 0.014101
Output for 5.5.24
Size: 999 Total time: 0.002366 Total time: 0.021301
Output for 5.4.45
Size: 1000 Total time: 0.001401 Total time: 0.013347
Output for 5.4.44
Size: 1000 Total time: 0.001386 Total time: 0.013203
Output for 5.4.43
Size: 999 Total time: 0.001300 Total time: 0.012980
Output for 5.4.42
Size: 999 Total time: 0.001346 Total time: 0.013716
Output for 5.4.41
Size: 999 Total time: 0.001346 Total time: 0.013023
Output for 5.4.40
Size: 1000 Total time: 0.001570 Total time: 0.015467
Output for 5.4.39
Size: 1000 Total time: 0.001357 Total time: 0.013161
Output for 5.4.38
Size: 999 Total time: 0.001324 Total time: 0.013439
Output for 5.4.37
Size: 1000 Total time: 0.001277 Total time: 0.012667
Output for 5.4.36
Size: 1000 Total time: 0.001323 Total time: 0.013088
Output for 5.4.35
Size: 1000 Total time: 0.001317 Total time: 0.013020
Output for 5.4.34
Size: 1000 Total time: 0.001320 Total time: 0.013001
Output for 5.4.32
Size: 1000 Total time: 0.001281 Total time: 0.012715
Output for 5.4.31
Size: 998 Total time: 0.001283 Total time: 0.012925
Output for 5.4.30
Size: 1000 Total time: 0.001274 Total time: 0.012951
Output for 5.4.29
Size: 1000 Total time: 0.001322 Total time: 0.012913
Output for 5.4.28
Size: 999 Total time: 0.001353 Total time: 0.013175
Output for 5.4.27
Size: 998 Total time: 0.001824 Total time: 0.017796
Output for 5.4.26
Size: 1000 Total time: 0.002497 Total time: 0.013984
Output for 5.4.25
Size: 999 Total time: 0.001502 Total time: 0.013530
Output for 5.4.24
Size: 1000 Total time: 0.001901 Total time: 0.015994
Output for 5.4.23
Size: 1000 Total time: 0.001275 Total time: 0.012816
Output for 5.4.22
Size: 999 Total time: 0.001368 Total time: 0.013075
Output for 5.4.21
Size: 999 Total time: 0.001379 Total time: 0.014327
Output for 5.4.20
Size: 999 Total time: 0.001329 Total time: 0.013293
Output for 5.4.19
Size: 998 Total time: 0.001332 Total time: 0.012879
Output for 5.4.18
Size: 999 Total time: 0.001388 Total time: 0.012864
Output for 5.4.17
Size: 1000 Total time: 0.001376 Total time: 0.012922
Output for 5.4.16
Size: 999 Total time: 0.001334 Total time: 0.013129
Output for 5.4.15
Size: 1000 Total time: 0.001813 Total time: 0.016625
Output for 5.4.14
Size: 1000 Total time: 0.001406 Total time: 0.014253
Output for 5.4.13
Size: 1000 Total time: 0.001325 Total time: 0.013353
Output for 5.4.12
Size: 1000 Total time: 0.001370 Total time: 0.013563
Output for 5.4.11
Size: 999 Total time: 0.002854 Total time: 0.018163
Output for 5.4.10
Size: 1000 Total time: 0.001380 Total time: 0.013409
Output for 5.4.9
Size: 1000 Total time: 0.001381 Total time: 0.013045
Output for 5.4.8
Size: 999 Total time: 0.001498 Total time: 0.013640
Output for 5.4.7
Size: 1000 Total time: 0.001336 Total time: 0.013246
Output for 5.4.6
Size: 999 Total time: 0.001368 Total time: 0.013416
Output for 5.4.5
Size: 999 Total time: 0.001381 Total time: 0.013219
Output for 5.4.4
Size: 1000 Total time: 0.001369 Total time: 0.013515
Output for 5.4.3
Size: 1000 Total time: 0.001373 Total time: 0.013408
Output for 5.4.2
Size: 1000 Total time: 0.001352 Total time: 0.013355
Output for 5.4.1
Size: 998 Total time: 0.001426 Total time: 0.013452
Output for 5.4.0
Size: 1000 Total time: 0.001337 Total time: 0.015074
Output for 5.3.29
Size: 1000 Total time: 0.001462 Total time: 0.013196
Output for 5.3.28
Size: 1000 Total time: 0.002240 Total time: 0.014454
Output for 5.3.27
Size: 1000 Total time: 0.001542 Total time: 0.013796
Output for 5.3.26
Size: 1000 Total time: 0.001522 Total time: 0.013285
Output for 5.3.25
Size: 998 Total time: 0.001508 Total time: 0.015362
Output for 5.3.24
Size: 1000 Total time: 0.001781 Total time: 0.016111
Output for 5.3.23
Size: 1000 Total time: 0.001538 Total time: 0.013231
Output for 5.3.22
Size: 999 Total time: 0.001653 Total time: 0.014243
Output for 5.3.21
Size: 1000 Total time: 0.001570 Total time: 0.013781
Output for 5.3.20
Size: 1000 Total time: 0.002652 Total time: 0.018159
Output for 5.3.19
Size: 998 Total time: 0.001524 Total time: 0.013681
Output for 5.3.18
Size: 1000 Total time: 0.001536 Total time: 0.013418
Output for 5.3.17
Size: 997 Total time: 0.001569 Total time: 0.013651
Output for 5.3.16
Size: 998 Total time: 0.001574 Total time: 0.013865
Output for 5.3.15
Size: 1000 Total time: 0.001569 Total time: 0.013921
Output for 5.3.14
Size: 999 Total time: 0.001536 Total time: 0.013136
Output for 5.3.13
Size: 999 Total time: 0.001763 Total time: 0.013734
Output for 5.3.12
Size: 1000 Total time: 0.001537 Total time: 0.013250
Output for 5.3.11
Size: 1000 Total time: 0.001594 Total time: 0.013763
Output for 5.3.10
Size: 1000 Total time: 0.001596 Total time: 0.013810
Output for 5.3.9
Size: 999 Total time: 0.001704 Total time: 0.013909
Output for 5.3.8
Size: 1000 Total time: 0.001652 Total time: 0.013858
Output for 5.3.7
Size: 999 Total time: 0.001568 Total time: 0.013852
Output for 5.3.6
Size: 1000 Total time: 0.001591 Total time: 0.013365
Output for 5.3.5
Size: 999 Total time: 0.001712 Total time: 0.013499
Output for 5.3.4
Size: 998 Total time: 0.001695 Total time: 0.013248
Output for 5.3.3
Size: 1000 Total time: 0.001592 Total time: 0.013799
Output for 5.3.2
Size: 1000 Total time: 0.001674 Total time: 0.013568
Output for 5.3.1
Size: 999 Total time: 0.001637 Total time: 0.013406
Output for 5.3.0
Size: 1000 Total time: 0.002327 Total time: 0.017766
Output for 5.2.17
Size: 1000 Total time: 0.001787 Total time: 0.018712
Output for 5.2.16
Size: 1000 Total time: 0.001692 Total time: 0.019828
Output for 5.2.15
Size: 999 Total time: 0.001783 Total time: 0.020301
Output for 5.2.14
Size: 1000 Total time: 0.001863 Total time: 0.018511
Output for 5.2.13
Size: 999 Total time: 0.001694 Total time: 0.018828
Output for 5.2.12
Size: 1000 Total time: 0.001707 Total time: 0.019386
Output for 5.2.11
Size: 999 Total time: 0.001692 Total time: 0.019237
Output for 5.2.10
Size: 999 Total time: 0.003158 Total time: 0.031744
Output for 5.2.9
Size: 999 Total time: 0.002894 Total time: 0.028979
Output for 5.2.8
Size: 1000 Total time: 0.001712 Total time: 0.019233
Output for 5.2.7
Size: 1000 Total time: 0.001725 Total time: 0.019218
Output for 5.2.6
Size: 1000 Total time: 0.001729 Total time: 0.020176
Output for 5.2.5
Size: 998 Total time: 0.002526 Total time: 0.024221
Output for 5.2.4
Size: 999 Total time: 0.002032 Total time: 0.021797
Output for 5.2.3
Size: 1000 Total time: 0.001748 Total time: 0.019926
Output for 5.2.2
Size: 998 Total time: 0.001712 Total time: 0.019520
Output for 5.2.1
Size: 999 Total time: 0.001645 Total time: 0.019430
Output for 5.2.0
Size: 999 Total time: 0.001955 Total time: 0.022086
Output for 5.1.6
Size: 1000 Total time: 0.001657 Total time: 0.020231
Output for 5.1.5
Size: 999 Total time: 0.001554 Total time: 0.020320
Output for 5.1.4
Size: 1000 Total time: 0.001614 Total time: 0.020528
Output for 5.1.3
Size: 998 Total time: 0.001659 Total time: 0.019684
Output for 5.1.2
Size: 999 Total time: 0.001631 Total time: 0.019093
Output for 5.1.1
Size: 1000 Total time: 0.001506 Total time: 0.019056
Output for 5.1.0
Size: 1000 Total time: 0.001533 Total time: 0.019379
Output for 5.0.5
Size: 999 Total time: 0.002677 Total time: 0.020023
Output for 5.0.4
Size: 999 Total time: 0.002584 Total time: 0.018637
Output for 5.0.3
Size: 999 Total time: 0.002515 Total time: 0.019632
Output for 5.0.2
Size: 998 Total time: 0.002918 Total time: 0.021028
Output for 5.0.1
Size: 1000 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 8 PHP_EOLTotal time: 0.002854 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 17 PHP_EOLTotal time: 0.021419 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 26 PHP_EOL
Output for 5.0.0
Size: 1000 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 8 PHP_EOLTotal time: 0.002709 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 17 PHP_EOLTotal time: 0.020072 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 26 PHP_EOL
Output for 4.4.9
Size: 999 Total time: 0.002759 Total time: 0.019000
Output for 4.4.8
Size: 999 Total time: 0.002793 Total time: 0.020083
Output for 4.4.7
Size: 999 Total time: 0.002848 Total time: 0.018610
Output for 4.4.6
Size: 1000 Total time: 0.002775 Total time: 0.018532
Output for 4.4.5
Size: 1000 Total time: 0.004437 Total time: 0.024411
Output for 4.4.4
Size: 1000 Total time: 0.002807 Total time: 0.018960
Output for 4.4.3
Size: 999 Total time: 0.002663 Total time: 0.017662
Output for 4.4.2
Size: 999 Total time: 0.002671 Total time: 0.017766
Output for 4.4.1
Size: 999 Total time: 0.002565 Total time: 0.017193
Output for 4.4.0
Size: 1000 Total time: 0.002861 Total time: 0.018371
Output for 4.3.11
Size: 1000 Total time: 0.002589 Total time: 0.017252
Output for 4.3.10
Size: 1000 Total time: 0.002590 Total time: 0.018172
Output for 4.3.9
Size: 1000 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 8 PHP_EOLTotal time: 0.002916 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 17 PHP_EOLTotal time: 0.021108 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 26 PHP_EOL
Output for 4.3.8
Size: 1000 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 8 PHP_EOLTotal time: 0.003068 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 17 PHP_EOLTotal time: 0.020984 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 26 PHP_EOL
Output for 4.3.7
Size: 998 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 8 PHP_EOLTotal time: 0.002576 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 17 PHP_EOLTotal time: 0.017530 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 26 PHP_EOL
Output for 4.3.6
Size: 1000 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 8 PHP_EOLTotal time: 0.002611 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 17 PHP_EOLTotal time: 0.018570 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 26 PHP_EOL
Output for 4.3.5
Size: 1000 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 8 PHP_EOLTotal time: 0.003167 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 17 PHP_EOLTotal time: 0.021580 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 26 PHP_EOL
Output for 4.3.4
Size: 998 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 8 PHP_EOLTotal time: 0.002542 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 17 PHP_EOLTotal time: 0.018513 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 26 PHP_EOL
Output for 4.3.3
Size: 999 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 8 PHP_EOLTotal time: 0.002563 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 17 PHP_EOLTotal time: 0.017471 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 26 PHP_EOL
Output for 4.3.2
Size: 998 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 8 PHP_EOLTotal time: 0.014017 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 17 PHP_EOLTotal time: 0.019255 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 26 PHP_EOL
Output for 4.3.1
Size: 1000 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 8 PHP_EOLTotal time: 0.014303 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 17 PHP_EOLTotal time: 0.020691 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 26 PHP_EOL
Output for 4.3.0
Size: 1000 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 8 PHP_EOLTotal time: 0.013959 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 17 PHP_EOLTotal time: 0.019432 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/p7aCW on line 26 PHP_EOL