3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $tstart = microtime(true); $numberOfRandoms = 500; $uniques = array(); for($i = 0; $i < $numberOfRandoms; $i++) { do { $code = mt_rand(10000,99999); } while(in_array($code, $uniques)); $uniques[] = $code; } $elapsed = microtime(true) - $tstart; echo $elapsed . PHP_EOL; $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;
Output for 7.1.0
0.00033879280090332 0.0007331371307373 0.0051290988922119
Output for 7.0.14
0.00033903121948242 0.00066804885864258 0.0032620429992676
Output for 7.0.6
0.00017690658569336 0.00042200088500977 0.0029408931732178
Output for 7.0.5
0.00024700164794922 0.00059199333190918 0.0038778781890869
Output for 7.0.4
0.00016689300537109 0.00039100646972656 0.0024008750915527
Output for 7.0.3
0.00021791458129883 0.00056910514831543 0.0064709186553955
Output for 7.0.2
0.00025200843811035 0.0006709098815918 0.0093059539794922
Output for 7.0.1
0.00020599365234375 0.00054812431335449 0.0035490989685059
Output for 7.0.0
0.0001680850982666 0.00040602684020996 0.0029540061950684
Output for hhvm-3.12.0
0.0033779144287109 0.0037670135498047 0.051836967468262
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.28
0.0026700496673584 0.0078511238098145 0.040332794189453
Output for 5.6.21
0.0025510787963867 0.006321907043457 0.035004854202271
Output for 5.6.20
0.0021378993988037 0.0050699710845947 0.030442953109741
Output for 5.6.19
0.0027229785919189 0.0076239109039307 0.047410011291504
Output for 5.6.18
0.0022859573364258 0.0056707859039307 0.031999111175537
Output for 5.6.17
0.0029840469360352 0.0067970752716064 0.039840936660767
Output for 5.6.16
0.0028660297393799 0.0067770481109619 0.039993047714233
Output for 5.6.15
0.0033340454101562 0.0070180892944336 0.040388822555542
Output for 5.6.14
0.0020279884338379 0.0053780078887939 0.031260967254639
Output for 5.6.13
0.0022530555725098 0.0054700374603271 0.035490989685059
Output for 5.6.12
0.0030710697174072 0.0070419311523438 0.039417028427124
Output for 5.6.11
0.0027170181274414 0.006540060043335 0.036817073822021
Output for 5.6.10
0.0019040107727051 0.0045790672302246 0.029107093811035
Output for 5.6.9
0.0030028820037842 0.007080078125 0.039057016372681
Output for 5.6.8
0.0019218921661377 0.0045959949493408 0.031944990158081
Output for 5.6.7
0.0018630027770996 0.0044610500335693 0.02634596824646
Output for 5.5.35
0.0026431083679199 0.006587028503418 0.036979913711548
Output for 5.5.34
0.0018560886383057 0.004382848739624 0.036127090454102
Output for 5.5.33
0.00301194190979 0.0072181224822998 0.044046878814697
Output for 5.5.32
0.0026509761810303 0.0063679218292236 0.0419921875
Output for 5.5.31
0.0020020008087158 0.0049459934234619 0.034142971038818
Output for 5.5.30
0.0023560523986816 0.005709171295166 0.038211107254028
Output for 5.5.29
0.002985954284668 0.0071580410003662 0.04538893699646
Output for 5.5.28
0.0018951892852783 0.0045168399810791 0.038784027099609
Output for 5.5.27
0.0019221305847168 0.0046868324279785 0.043627023696899
Output for 5.5.26
0.0030059814453125 0.0072221755981445 0.043281078338623
Output for 5.5.25
0.0022029876708984 0.0053620338439941 0.035459995269775
Output for 5.5.24
0.0020458698272705 0.0048689842224121 0.030225992202759
Output for 5.4.45
0.0027260780334473 0.0067839622497559 0.040934085845947
Output for 5.4.44
0.0022211074829102 0.00547194480896 0.042484998703003
Output for 5.4.43
0.0020709037780762 0.0059130191802979 0.039906024932861
Output for 5.4.42
0.0017712116241455 0.0044200420379639 0.028110980987549
Output for 5.4.41
0.0020220279693604 0.0053980350494385 0.030575037002563
Output for 5.4.40
0.0017819404602051 0.0049891471862793 0.035664081573486
Output for 5.4.39
0.0017948150634766 0.0045650005340576 0.032602787017822
Output for 5.4.38
0.0017759799957275 0.0045678615570068 0.034462928771973
Output for 5.4.37
0.0017938613891602 0.0046670436859131 0.033746957778931
Output for 5.4.36
0.0020790100097656 0.0054559707641602 0.037873029708862
Output for 5.4.35
0.0022139549255371 0.0046870708465576 0.032881021499634
Output for 5.4.34
0.00189208984375 0.0050098896026611 0.030658960342407
Output for 5.4.32
0.0026960372924805 0.0076110363006592 0.040960073471069
Output for 5.4.31
0.0026929378509521 0.0069160461425781 0.041932821273804
Output for 5.4.30
0.0027420520782471 0.0071220397949219 0.041021108627319
Output for 5.4.29
0.0027461051940918 0.0072450637817383 0.04140305519104
Output for 5.4.28
0.0025770664215088 0.0064749717712402 0.038918972015381
Output for 5.4.27
0.0034210681915283 0.010684013366699 0.036659955978394
Output for 5.4.26
0.0017869472503662 0.0045700073242188 0.03181791305542
Output for 5.4.25
0.0024669170379639 0.0058460235595703 0.040384769439697
Output for 5.4.24
0.0023469924926758 0.0061509609222412 0.036952972412109
Output for 5.4.23
0.0019950866699219 0.0053069591522217 0.03466010093689
Output for 5.4.22
0.0024387836456299 0.0060060024261475 0.035722017288208
Output for 5.4.21
0.003046989440918 0.0074820518493652 0.044066905975342
Output for 5.4.20
0.0023081302642822 0.0058450698852539 0.037496089935303
Output for 5.4.19
0.0019211769104004 0.0051000118255615 0.037251949310303
Output for 5.4.18
0.0026650428771973 0.0070271492004395 0.041034936904907
Output for 5.4.17
0.0020899772644043 0.0059390068054199 0.034467935562134
Output for 5.4.16
0.0027701854705811 0.0067551136016846 0.041254043579102
Output for 5.4.15
0.0022549629211426 0.0057508945465088 0.042635917663574
Output for 5.4.14
0.0026848316192627 0.0070629119873047 0.041765213012695
Output for 5.4.13
0.0027060508728027 0.0068039894104004 0.041333913803101
Output for 5.4.12
0.0020401477813721 0.0048129558563232 0.032356977462769
Output for 5.4.11
0.0018148422241211 0.0045950412750244 0.031457901000977
Output for 5.4.10
0.001835823059082 0.0048580169677734 0.032424926757812
Output for 5.4.9
0.0018389225006104 0.0048940181732178 0.031704902648926
Output for 5.4.8
0.002791166305542 0.0069029331207275 0.041776895523071
Output for 5.4.7
0.0018141269683838 0.0047190189361572 0.031996011734009
Output for 5.4.6
0.0023860931396484 0.0064151287078857 0.038450002670288
Output for 5.4.5
0.0027499198913574 0.0067381858825684 0.041234970092773
Output for 5.4.4
0.0027530193328857 0.0073931217193604 0.042227983474731
Output for 5.4.3
0.0027961730957031 0.0071039199829102 0.041054964065552
Output for 5.4.2
0.0027451515197754 0.0072090625762939 0.053314924240112
Output for 5.4.1
0.0021388530731201 0.005530834197998 0.036233901977539
Output for 5.4.0
0.0028159618377686 0.006742000579834 0.040872097015381
Output for 5.3.29
0.0028657913208008 0.0064740180969238 0.03947901725769
Output for 5.3.28
0.0026171207427979 0.0065171718597412 0.040014028549194
Output for 5.3.27
0.0027220249176025 0.0068280696868896 0.040570020675659
Output for 5.3.26
0.0018949508666992 0.0045740604400635 0.031781911849976
Output for 5.3.25
0.0028271675109863 0.0070319175720215 0.044642925262451
Output for 5.3.24
0.002183198928833 0.0052969455718994 0.042246103286743
Output for 5.3.23
0.0026941299438477 0.0068080425262451 0.040761947631836
Output for 5.3.22
0.0025448799133301 0.0057590007781982 0.040964126586914
Output for 5.3.21
0.0018160343170166 0.0045280456542969 0.0330810546875
Output for 5.3.20
0.0024027824401855 0.0059409141540527 0.034042119979858
Output for 5.3.19
0.0039119720458984 0.010269165039062 0.040045976638794
Output for 5.3.18
0.0018391609191895 0.0045619010925293 0.032335042953491
Output for 5.3.17
0.0029678344726562 0.0071330070495605 0.054871082305908
Output for 5.3.16
0.0027689933776855 0.0064480304718018 0.036411046981812
Output for 5.3.15
0.0026829242706299 0.0064420700073242 0.040534973144531
Output for 5.3.14
0.0024070739746094 0.0057270526885986 0.039466142654419
Output for 5.3.13
0.0027780532836914 0.0068140029907227 0.0416419506073
Output for 5.3.12
0.002701997756958 0.0069179534912109 0.042320013046265
Output for 5.3.11
0.0028221607208252 0.007418155670166 0.0448899269104
Output for 5.3.10
0.0018448829650879 0.0046608448028564 0.032080173492432
Output for 5.3.9
0.0026240348815918 0.0050339698791504 0.035287141799927
Output for 5.3.8
0.0023579597473145 0.0058341026306152 0.038273096084595
Output for 5.3.7
0.0029599666595459 0.0069260597229004 0.044116020202637
Output for 5.3.6
0.0025761127471924 0.0064520835876465 0.044457912445068
Output for 5.3.5
0.0019569396972656 0.0049989223480225 0.03376293182373
Output for 5.3.4
0.0022609233856201 0.0058190822601318 0.03728985786438
Output for 5.3.3
0.0026140213012695 0.007174015045166 0.039818048477173
Output for 5.3.2
0.0023620128631592 0.0063221454620361 0.036671876907349
Output for 5.3.1
0.0028719902038574 0.0068590641021729 0.042923927307129
Output for 5.3.0
0.003140926361084 0.0073308944702148 0.041548013687134
Output for 5.2.17
0.0037128925323486 0.0077559947967529 0.039373159408569
Output for 5.2.16
0.0041568279266357 0.0079751014709473 0.043216943740845
Output for 5.2.15
0.0042488574981689 0.0085501670837402 0.039103984832764
Output for 5.2.14
0.0036230087280273 0.0077230930328369 0.038938045501709
Output for 5.2.13
0.0025529861450195 0.0054168701171875 0.031105995178223
Output for 5.2.12
0.0045831203460693 0.0089778900146484 0.044219970703125
Output for 5.2.11
0.0039699077606201 0.0077760219573975 0.040855169296265
Output for 5.2.10
0.0043060779571533 0.0090489387512207 0.044392108917236
Output for 5.2.9
0.0043981075286865 0.0085439682006836 0.03835391998291
Output for 5.2.8
0.0044360160827637 0.0087161064147949 0.042849779129028
Output for 5.2.7
0.0040760040283203 0.0082719326019287 0.042157888412476
Output for 5.2.6
0.0026841163635254 0.0054211616516113 0.030561923980713
Output for 5.2.5
0.0033750534057617 0.0068418979644775 0.037812948226929
Output for 5.2.4
0.0042808055877686 0.0083110332489014 0.042273044586182
Output for 5.2.3
0.0033111572265625 0.0061380863189697 0.035988807678223
Output for 5.2.2
0.0039958953857422 0.0080580711364746 0.043248176574707
Output for 5.2.1
0.0041229724884033 0.0088560581207275 0.043413162231445
Output for 5.2.0
0.0027198791503906 0.0062320232391357 0.033703088760376
Output for 5.1.6
0.0026669502258301 0.0064401626586914 0.03744912147522
Output for 5.1.5
0.0047268867492676 0.011286973953247 0.048893928527832
Output for 5.1.4
0.0048749446868896 0.010946035385132 0.054672002792358
Output for 5.1.3
0.0036258697509766 0.008868932723999 0.041195869445801
Output for 5.1.2
0.0046391487121582 0.013115167617798 0.040356159210205
Output for 5.1.1
0.0041060447692871 0.010229825973511 0.048902988433838
Output for 5.1.0
0.004734992980957 0.011667966842651 0.051191091537476
Output for 5.0.5
0.0049920082092285 0.015527963638306 0.054512023925781
Output for 5.0.4
0.004584789276123 0.012824058532715 0.050068140029907
Output for 5.0.3
0.0033919811248779 0.0096409320831299 0.041310787200928
Output for 5.0.2
0.0041959285736084 0.011074066162109 0.04626989364624
Output for 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 15 0.0055170059204102PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 29 0.014025926589966PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 41 0.053822040557861PHP_EOL
Output for 5.0.0
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 15 0.0046701431274414PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 29 0.012603044509888PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 41 0.049259901046753PHP_EOL
Output for 4.4.9
0.005179 0.013871 0.053973
Output for 4.4.8
0.004972 0.01487 0.050643
Output for 4.4.7
0.002626 0.008033 0.042733
Output for 4.4.6
0.0043939999999999 0.012211 0.048092
Output for 4.4.5
0.005446 0.0155 0.058627
Output for 4.4.4
0.0038400000000001 0.009574 0.041911
Output for 4.4.3
0.00316 0.010143 0.045304
Output for 4.4.2
0.002917 0.009278 0.040985
Output for 4.4.1
0.0048699999999999 0.014194 0.053829
Output for 4.4.0
0.004404 0.013172 0.050785
Output for 4.3.11
0.004927 0.013536 0.054526
Output for 4.3.10
0.004725 0.013939 -0.936126
Output for 4.3.9
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 15 0.005912PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 29 0.019354PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 41 0.055332PHP_EOL
Output for 4.3.8
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 15 0.003259PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 29 0.011697PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 41 0.047098PHP_EOL
Output for 4.3.7
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 15 0.004229PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 29 0.012082PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 41 0.048677PHP_EOL
Output for 4.3.6
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 15 0.004327PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 29 0.01228PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 41 0.050091PHP_EOL
Output for 4.3.5
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 15 0.004274PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 29 0.012402PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 41 0.046451PHP_EOL
Output for 4.3.4
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 15 0.002641PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 29 0.007907PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 41 0.038793PHP_EOL
Output for 4.3.3
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 15 0.0025310000000001PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 29 0.007618PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 41 -0.96214PHP_EOL
Output for 4.3.2
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 15 0.003387PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 29 0.009078PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 41 0.037276PHP_EOL
Output for 4.3.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 15 0.006701PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 29 0.015479PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 41 0.048071PHP_EOL
Output for 4.3.0
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 15 0.007072PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 29 0.01537PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lU9oT on line 41 0.048171PHP_EOL