3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $tstart = microtime(true); $numberOfRandoms = 500; $uniques = array(); do { $uniques[mt_rand(10000, 99999)] = true; } while(count(array_keys($uniques)) < $numberOfRandoms); $uniques = array_keys($uniques); $elapsed = microtime(true) - $tstart; echo $elapsed . PHP_EOL; $tstart = microtime(true); $uniques = range(10000, 99999); shuffle($uniques); $uniques = array_slice($uniques, 0, 500); $elapsed = microtime(true) - $tstart; echo $elapsed . PHP_EOL; $tstart = microtime(true); $uniques = array(); for($i = 0; $i < 500; $i++) { do { $code = mt_rand(10000, 99999); } while(in_array($code, $uniques)); $uniques[] = $code; } $elapsed = microtime(true) - $tstart; echo $elapsed . PHP_EOL; ?>
based on MtABr
Output for 7.1.0
0.00069999694824219 0.0049149990081787 0.00033283233642578
Output for 7.0.14
0.00065302848815918 0.0031089782714844 0.00030899047851562
Output for 7.0.6
0.00059986114501953 0.0080499649047852 0.00023293495178223
Output for 7.0.5
0.00053286552429199 0.0035338401794434 0.00022411346435547
Output for 7.0.4
0.00041508674621582 0.0026280879974365 0.00017118453979492
Output for 7.0.3
0.00052499771118164 0.010254859924316 0.00019311904907227
Output for 7.0.2
0.0006248950958252 0.00895094871521 0.00024914741516113
Output for 7.0.1
0.00062894821166992 0.0042569637298584 0.0002601146697998
Output for 7.0.0
0.0007178783416748 0.0048210620880127 0.0002901554107666
Output for hhvm-3.12.0
0.0014879703521729 0.010073900222778 0.0012550354003906
Output for hhvm-3.10.0
0.0018651485443115 0.0051651000976562 0.0013790130615234
Output for 5.6.28
0.007997989654541 -0.020491123199463 -0.0027270317077637
Output for 5.6.21
0.0061519145965576 0.035165071487427 0.0025548934936523
Output for 5.6.20
0.0059249401092529 0.037010192871094 0.002554178237915
Output for 5.6.19
0.0068709850311279 0.040741920471191 0.0028519630432129
Output for 5.6.18
0.0052089691162109 0.03715705871582 0.002479076385498
Output for 5.6.17
0.006335973739624 0.037922143936157 0.0027539730072021
Output for 5.6.16
0.0047140121459961 0.031861782073975 0.0022730827331543
Output for 5.6.15
0.0066249370574951 0.038486003875732 0.0028359889984131
Output for 5.6.14
0.0072000026702881 0.039204120635986 0.002647876739502
Output for 5.6.13
0.006382942199707 0.042047023773193 0.002669095993042
Output for 5.6.12
0.007317066192627 0.039067029953003 0.0031781196594238
Output for 5.6.11
0.0058350563049316 0.031190872192383 0.0024969577789307
Output for 5.6.10
0.0048470497131348 0.030051231384277 0.0023150444030762
Output for 5.6.9
0.0072569847106934 0.045444011688232 0.0029749870300293
Output for 5.6.8
0.0045490264892578 0.030839920043945 0.0023300647735596
Output for 5.5.35
0.0045971870422363 0.028059005737305 0.0022480487823486
Output for 5.5.34
0.0050139427185059 0.036091089248657 0.0024220943450928
Output for 5.5.33
0.0064499378204346 0.043869972229004 0.0027561187744141
Output for 5.5.32
0.0054030418395996 0.03394079208374 0.0025379657745361
Output for 5.5.31
0.0060439109802246 0.044533014297485 0.0025899410247803
Output for 5.5.30
0.0072791576385498 0.039971113204956 0.0025579929351807
Output for 5.5.29
0.0067241191864014 0.038088083267212 0.0024089813232422
Output for 5.5.28
0.0045309066772461 0.033945083618164 0.0023579597473145
Output for 5.5.27
0.0047869682312012 0.041348934173584 0.0023901462554932
Output for 5.5.26
0.0067589282989502 0.040528059005737 0.002924919128418
Output for 5.5.25
0.0060608386993408 0.036363124847412 0.0026299953460693
Output for 5.5.24
0.00565505027771 0.0329749584198 0.0024209022521973
Output for 5.4.45
0.0067548751831055 0.088058233261108 0.0034101009368896
Output for 5.4.44
0.0078341960906982 0.20440697669983 0.0046360492706299
Output for 5.4.43
0.0071620941162109 0.083341121673584 0.0037379264831543
Output for 5.4.42
0.0071010589599609 0.086000919342041 0.0037031173706055
Output for 5.4.41
0.024893045425415 0.18736004829407 0.0039260387420654
Output for 5.4.40
0.0082077980041504 0.09178900718689 0.0040140151977539
Output for 5.4.39
0.0075380802154541 0.14488005638123 0.0042679309844971
Output for 5.4.38
0.025145053863525 0.21161913871765 0.0041148662567139
Output for 5.4.37
0.0054399967193604 0.049356937408447 0.002586841583252
Output for 5.4.36
0.0052511692047119 0.05519700050354 0.0027649402618408
Output for 5.4.35
0.0051579475402832 0.059205055236816 0.0027568340301514
Output for 5.4.34
0.0055921077728271 0.057438135147095 0.0033118724822998
Output for 5.4.32
0.0050039291381836 0.045984983444214 0.0028738975524902
Output for 5.4.31
0.004951000213623 0.045161962509155 0.0026371479034424
Output for 5.4.30
0.009084939956665 0.051095962524414 0.0027101039886475
Output for 5.4.29
0.0050840377807617 0.047167062759399 0.0032939910888672
Output for 5.4.28
0.0051178932189941 0.047589778900146 0.0025568008422852
Output for 5.4.27
0.0050590038299561 0.046987056732178 0.0027108192443848
Output for 5.4.26
0.0054159164428711 0.054835081100464 0.0027251243591309
Output for 5.4.25
0.005079984664917 0.046396017074585 0.0027570724487305
Output for 5.4.24
0.0052340030670166 0.04966402053833 0.0028591156005859
Output for 5.4.23
0.0053000450134277 0.051687002182007 0.0028200149536133
Output for 5.4.22
0.0053870677947998 0.048595905303955 0.0028331279754639
Output for 5.4.21
0.0091021060943604 0.069504022598267 0.0027508735656738
Output for 5.4.20
0.0053129196166992 0.055000066757202 0.0028800964355469
Output for 5.4.19
0.0058319568634033 0.053436994552612 0.0032191276550293
Output for 5.4.18
0.0054330825805664 0.047486066818237 0.0026078224182129
Output for 5.4.17
0.0051350593566895 0.045269966125488 0.0026130676269531
Output for 5.4.16
0.0071570873260498 0.045996189117432 0.0026800632476807
Output for 5.4.15
0.0048928260803223 0.042902946472168 0.0025439262390137
Output for 5.4.14
0.0089008808135986 0.050707101821899 0.0027339458465576
Output for 5.4.13
0.00543212890625 0.044558048248291 0.0027530193328857
Output for 5.4.12
0.0096991062164307 0.056137084960938 0.002763032913208
Output for 5.4.11
0.0055270195007324 0.050820112228394 0.0030598640441895
Output for 5.4.10
0.005385160446167 0.044433116912842 0.0027589797973633
Output for 5.4.9
0.0052909851074219 0.044512033462524 0.0029430389404297
Output for 5.4.8
0.0049958229064941 0.046706914901733 0.0027740001678467
Output for 5.4.7
0.0052638053894043 0.04867696762085 0.0029950141906738
Output for 5.4.6
0.0051259994506836 0.044986009597778 0.0026979446411133
Output for 5.4.5
0.0054519176483154 0.050744771957397 0.0028259754180908
Output for 5.4.4
0.0055098533630371 0.052394151687622 0.002824068069458
Output for 5.4.3
0.005342960357666 0.049007177352905 0.0027430057525635
Output for 5.4.2
0.0052189826965332 0.042655944824219 0.002640962600708
Output for 5.4.1
0.0058000087738037 0.044836044311523 0.0030319690704346
Output for 5.4.0
0.0050609111785889 0.047224044799805 0.0028228759765625
Output for 5.3.29
0.0049839019775391 0.047474145889282 0.002673864364624
Output for 5.3.28
0.0047879219055176 0.046827077865601 0.0027120113372803
Output for 5.3.27
0.0049958229064941 0.046212911605835 0.0026490688323975
Output for 5.3.26
0.0048880577087402 0.044786930084229 0.0026957988739014
Output for 5.3.25
0.0050630569458008 0.045482873916626 0.0030419826507568
Output for 5.3.24
0.0048229694366455 0.051512956619263 0.0027651786804199
Output for 5.3.23
0.0049450397491455 0.052482843399048 0.0026521682739258
Output for 5.3.22
0.0050530433654785 0.046190977096558 0.0028059482574463
Output for 5.3.21
0.0050082206726074 0.050601005554199 0.0026798248291016
Output for 5.3.20
0.0048501491546631 0.04234504699707 0.002830982208252
Output for 5.3.19
0.0048420429229736 0.044542074203491 0.0025961399078369
Output for 5.3.18
0.0048072338104248 0.04775595664978 0.0025768280029297
Output for 5.3.17
0.0050108432769775 0.046455860137939 0.0027050971984863
Output for 5.3.16
0.0050621032714844 0.046757936477661 0.0028350353240967
Output for 5.3.15
0.0046489238739014 0.046418905258179 0.002593994140625
Output for 5.3.14
0.0062980651855469 0.056995868682861 0.0028519630432129
Output for 5.3.13
0.0049991607666016 0.050766944885254 0.002716064453125
Output for 5.3.12
0.0048649311065674 0.050143957138062 0.0027298927307129
Output for 5.3.11
0.0051159858703613 0.044220209121704 0.0026819705963135
Output for 5.3.10
0.0050530433654785 0.04806113243103 0.0027358531951904
Output for 5.3.9
0.0049359798431396 0.047806978225708 0.0026099681854248
Output for 5.3.8
0.004828929901123 0.046108961105347 0.0030491352081299
Output for 5.3.7
0.0049331188201904 0.056272029876709 0.0027790069580078
Output for 5.3.6
0.0050220489501953 0.048911094665527 0.0027060508728027
Output for 5.3.5
0.005443811416626 0.052511930465698 0.0029070377349854
Output for 5.3.4
0.0052809715270996 0.049865961074829 0.0026309490203857
Output for 5.3.3
0.0065741539001465 0.0525221824646 0.0033450126647949
Output for 5.3.2
0.011675119400024 0.054202795028687 0.003140926361084
Output for 5.3.1
0.0052151679992676 0.05517315864563 0.0026640892028809
Output for 5.3.0
0.0055749416351318 0.056191921234131 0.0031521320343018
Output for 5.2.17
0.0058650970458984 0.051758050918579 0.0035250186920166
Output for 5.2.16
0.0056989192962646 0.055110931396484 0.0036540031433105
Output for 5.2.15
0.0058341026306152 0.054151058197021 0.0035099983215332
Output for 5.2.14
0.0057661533355713 0.050333023071289 0.0032980442047119
Output for 5.2.13
0.0059628486633301 0.050545930862427 0.0035150051116943
Output for 5.2.12
0.00577712059021 0.050278902053833 0.0036659240722656
Output for 5.2.11
0.0058741569519043 0.048923015594482 0.0033578872680664
Output for 5.2.10
0.0054171085357666 0.045974016189575 0.0033669471740723
Output for 5.2.9
0.0053558349609375 0.050337076187134 0.0039219856262207
Output for 5.2.8
0.0055179595947266 0.04913592338562 0.0035829544067383
Output for 5.2.7
0.0055999755859375 0.050462961196899 0.0035622119903564
Output for 5.2.6
0.0056538581848145 0.043592929840088 0.0034050941467285
Output for 5.2.5
0.0053069591522217 0.047904968261719 0.0033891201019287
Output for 5.2.4
0.0059659481048584 0.049454927444458 0.0034639835357666
Output for 5.2.3
0.005950927734375 0.048789978027344 0.0034642219543457
Output for 5.2.2
0.0055758953094482 0.051201105117798 0.0035879611968994
Output for 5.2.1
0.0065960884094238 0.045372009277344 0.0031599998474121
Output for 5.2.0
0.0061171054840088 0.041595935821533 0.0034289360046387
Output for 5.1.6
0.0069069862365723 0.044549942016602 0.0037319660186768
Output for 5.1.5
0.0067808628082275 0.046301126480103 0.027504920959473
Output for 5.1.4
0.0071220397949219 0.043521165847778 0.024064064025879
Output for 5.1.3
0.0071239471435547 0.051653146743774 0.028020858764648
Output for 5.1.2
0.0074670314788818 0.047717094421387 0.028083086013794
Output for 5.1.1
0.0079879760742188 0.05591893196106 0.021185874938965
Output for 5.1.0
0.0068659782409668 0.043798923492432 0.024367809295654
Output for 5.0.5
0.0076828002929688 0.043765068054199 0.023478031158447
Output for 5.0.4
0.0080940723419189 0.046758890151978 0.021251916885376
Output for 5.0.3
0.0077121257781982 0.043932914733887 0.022942066192627
Output for 5.0.2
0.0080010890960693 0.054355144500732 0.023411989212036
Output for 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 16 0.0077769756317139PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 28 0.043802976608276PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 42 0.025819063186646PHP_EOL
Output for 5.0.0
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 16 0.0076041221618652PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 28 0.046283960342407PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 42 0.02534294128418PHP_EOL
Output for 4.4.9
0.0079579999999999 0.046633 0.025002
Output for 4.4.8
0.008672 0.049049 0.028794
Output for 4.4.7
0.008046 0.052343 0.030587
Output for 4.4.6
-0.992186 0.046103 0.024585
Output for 4.4.5
0.007961 0.056823 0.032359
Output for 4.4.4
0.007789 0.051939 0.023302
Output for 4.4.3
0.0079 0.046121 0.024839
Output for 4.4.2
0.007969 0.04498 0.030091
Output for 4.4.1
0.0096419999999999 0.045217 0.024928
Output for 4.4.0
0.008498 0.049281 0.027812
Output for 4.3.11
0.008181 0.045289 0.026499
Output for 4.3.10
0.008136 0.048663 0.025707
Output for 4.3.9
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 16 0.007859PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 28 0.045989PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 42 0.025661PHP_EOL
Output for 4.3.8
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 16 0.008654PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 28 0.056858PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 42 0.02345PHP_EOL
Output for 4.3.7
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 16 0.008146PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 28 0.049862PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 42 0.023177PHP_EOL
Output for 4.3.6
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 16 0.007732PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 28 0.049698PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 42 0.023034PHP_EOL
Output for 4.3.5
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 16 0.007885PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 28 0.048635PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 42 0.02503PHP_EOL
Output for 4.3.4
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 16 0.0085299999999999PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 28 0.046666PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 42 0.024496PHP_EOL
Output for 4.3.3
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 16 0.007786PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 28 0.04717PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 42 0.030921PHP_EOL
Output for 4.3.2
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 16 0.010462PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 28 0.045314PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 42 0.025821PHP_EOL
Output for 4.3.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 16 0.0090589999999999PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 28 0.050278PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 42 0.025854PHP_EOL
Output for 4.3.0
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 16 0.012057PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 28 0.102421PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8EFWC on line 42 0.031764PHP_EOL