3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $tstart = microtime(true); $numberOfRandoms = 5000; $uniques = array(); do { $uniques[mt_rand(10000, 99999)] = true; } while(count(array_keys($uniques)) < $numberOfRandoms); $uniques = array_keys($uniques); $elapsed = microtime(true) - $tstart; echo "hek2mgl:\t\t\t" . $elapsed . PHP_EOL; $tstart = microtime(true); $uniques = range(10000, 99999); shuffle($uniques); $uniques = array_slice($uniques, 0, $numberOfRandoms); $elapsed = microtime(true) - $tstart; echo "Dave Chen:\t\t\t" . $elapsed . PHP_EOL; $tstart = microtime(true); $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 "Josh from Qaribou:\t\t" . $elapsed . PHP_EOL;
Output for 7.1.0
hek2mgl: 0.091552019119263 Dave Chen: 0.0038008689880371 Josh from Qaribou: 0.018216848373413
Output for 7.0.14
hek2mgl: 0.086811065673828 Dave Chen: 0.0024459362030029 Josh from Qaribou: 0.016983985900879
Output for 7.0.6
hek2mgl: 0.095058917999268 Dave Chen: 0.0029640197753906 Josh from Qaribou: 0.016884088516235
Output for 7.0.5
hek2mgl: 0.087507963180542 Dave Chen: 0.0027551651000977 Josh from Qaribou: 0.014750957489014
Output for 7.0.4
hek2mgl: 0.084060907363892 Dave Chen: 0.0028359889984131 Josh from Qaribou: 0.014714956283569
Output for 7.0.3
hek2mgl: 0.076372146606445 Dave Chen: 0.0056869983673096 Josh from Qaribou: 0.013466119766235
Output for 7.0.2
hek2mgl: 0.087732076644897 Dave Chen: 0.0090489387512207 Josh from Qaribou: 0.018360137939453
Output for 7.0.1
hek2mgl: 0.077099084854126 Dave Chen: 0.0026819705963135 Josh from Qaribou: 0.013399839401245
Output for 7.0.0
hek2mgl: 0.073693037033081 Dave Chen: 0.0028400421142578 Josh from Qaribou: 0.013537168502808
Output for hhvm-3.12.0
hek2mgl: 0.23082304000854 Dave Chen: 0.018275022506714 Josh from Qaribou: 0.20563292503357
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.28
hek2mgl: 0.74049615859985 Dave Chen: 0.03059720993042 Josh from Qaribou: 0.11349105834961
Output for 5.6.21
hek2mgl: 0.80344390869141 Dave Chen: 0.024930000305176 Josh from Qaribou: 0.32300686836243
Output for 5.6.20
hek2mgl: 0.79911017417908 Dave Chen: 0.027037143707275 Josh from Qaribou: 0.31821703910828
Output for 5.6.19
hek2mgl: 0.81602501869202 Dave Chen: 0.031208038330078 Josh from Qaribou: 0.32477188110352
Output for 5.6.18
hek2mgl: 0.75556182861328 Dave Chen: 0.029080152511597 Josh from Qaribou: 0.31650400161743
Output for 5.6.17
hek2mgl: 0.76203107833862 Dave Chen: 0.030373096466064 Josh from Qaribou: 0.32071495056152
Output for 5.6.16
hek2mgl: 0.79760694503784 Dave Chen: 0.034246921539307 Josh from Qaribou: 0.32303786277771
Output for 5.6.15
hek2mgl: 0.79573106765747 Dave Chen: 0.027000904083252 Josh from Qaribou: 0.3207049369812
Output for 5.6.14
hek2mgl: 0.7830798625946 Dave Chen: 0.028943061828613 Josh from Qaribou: 0.3173611164093
Output for 5.6.13
hek2mgl: 0.71663284301758 Dave Chen: 0.031095027923584 Josh from Qaribou: 0.3205099105835
Output for 5.6.12
hek2mgl: 0.77435612678528 Dave Chen: 0.0310959815979 Josh from Qaribou: 0.31838393211365
Output for 5.6.11
hek2mgl: 0.79041504859924 Dave Chen: 0.027113914489746 Josh from Qaribou: 0.32983684539795
Output for 5.6.10
hek2mgl: 0.79388499259949 Dave Chen: 0.025511980056763 Josh from Qaribou: 0.32124900817871
Output for 5.6.9
hek2mgl: 0.83659601211548 Dave Chen: 0.025779008865356 Josh from Qaribou: 0.34733295440674
Output for 5.6.8
hek2mgl: 0.81469178199768 Dave Chen: 0.028578042984009 Josh from Qaribou: 0.32191896438599
Output for 5.6.7
hek2mgl: 0.70674014091492 Dave Chen: 0.021347999572754 Josh from Qaribou: 0.27446413040161
Output for 5.5.35
hek2mgl: 0.63464403152466 Dave Chen: 0.031702041625977 Josh from Qaribou: 0.28027296066284
Output for 5.5.34
hek2mgl: 0.80868005752563 Dave Chen: 0.033612966537476 Josh from Qaribou: 0.32041811943054
Output for 5.5.33
hek2mgl: 0.77690696716309 Dave Chen: 0.030222177505493 Josh from Qaribou: 0.3171968460083
Output for 5.5.32
hek2mgl: 0.78514313697815 Dave Chen: 0.029445886611938 Josh from Qaribou: 0.31128716468811
Output for 5.5.31
hek2mgl: 0.78450703620911 Dave Chen: 0.029316902160645 Josh from Qaribou: 0.31850719451904
Output for 5.5.30
hek2mgl: 0.80901694297791 Dave Chen: 0.033312082290649 Josh from Qaribou: 0.33423805236816
Output for 5.5.29
hek2mgl: 0.72659611701965 Dave Chen: 0.043416023254395 Josh from Qaribou: 0.31843709945679
Output for 5.5.28
hek2mgl: 0.78107595443726 Dave Chen: 0.028483152389526 Josh from Qaribou: 0.31577110290527
Output for 5.5.27
hek2mgl: 0.74135708808899 Dave Chen: 0.033360004425049 Josh from Qaribou: 0.31892108917236
Output for 5.5.26
hek2mgl: 0.72001504898071 Dave Chen: 0.026450157165527 Josh from Qaribou: 0.3160560131073
Output for 5.5.25
hek2mgl: 0.79707098007202 Dave Chen: 0.027680158615112 Josh from Qaribou: 0.31776785850525
Output for 5.5.24
hek2mgl: 0.81541299819946 Dave Chen: 0.029025793075562 Josh from Qaribou: 0.3167130947113
Output for 5.4.45
hek2mgl: 1.1454148292542 Dave Chen: 0.077883005142212 Josh from Qaribou: 0.48476791381836
Output for 5.4.44
hek2mgl: 1.1827960014343 Dave Chen: 0.095406055450439 Josh from Qaribou: 0.66994094848633
Output for 5.4.43
hek2mgl: 1.1663691997528 Dave Chen: 0.097373008728027 Josh from Qaribou: 0.61605000495911
Output for 5.4.42
hek2mgl: 1.1543140411377 Dave Chen: 0.093616962432861 Josh from Qaribou: 0.64103388786316
Output for 5.4.41
hek2mgl: 1.1805319786072 Dave Chen: 0.065326929092407 Josh from Qaribou: 0.54619908332825
Output for 5.4.40
hek2mgl: 1.0968270301819 Dave Chen: 0.06008505821228 Josh from Qaribou: 0.5808961391449
Output for 5.4.39
hek2mgl: 1.2130079269409 Dave Chen: 0.087891817092896 Josh from Qaribou: 0.55838489532471
Output for 5.4.38
hek2mgl: 1.4697279930115 Dave Chen: 0.094873905181885 Josh from Qaribou: 0.62046384811401
Output for 5.4.37
hek2mgl: 1.3591928482056 Dave Chen: 0.084622144699097 Josh from Qaribou: 0.60653805732727
Output for 5.4.36
hek2mgl: 2.1422438621521
Process exited with code 137.
Output for 5.4.35
hek2mgl: 1.4963870048523 Dave Chen: 0.085926055908203 Josh from Qaribou: 0.62467622756958
Output for 5.4.34
hek2mgl: 1.8136510848999 Dave Chen: 0.14789891242981
Process exited with code 137.
Output for 5.4.32
hek2mgl: 0.75583291053772 Dave Chen: 0.048887014389038 Josh from Qaribou: 0.37920594215393
Output for 5.4.31
hek2mgl: 0.7524790763855 Dave Chen: 0.049666166305542 Josh from Qaribou: 0.37834596633911
Output for 5.4.30
hek2mgl: 0.78670597076416 Dave Chen: 0.051587820053101 Josh from Qaribou: 0.38882899284363
Output for 5.4.29
hek2mgl: 0.79234194755554 Dave Chen: 0.050337076187134 Josh from Qaribou: 0.36934494972229
Output for 5.4.28
hek2mgl: 0.93883609771729 Dave Chen: 0.076107025146484 Josh from Qaribou: 0.95210695266724
Output for 5.4.27
hek2mgl: 1.2722899913788 Dave Chen: 0.099785089492798 Josh from Qaribou: 0.6035099029541
Output for 5.4.26
hek2mgl: 1.8331530094147 Dave Chen: 0.12195682525635
Process exited with code 137.
Output for 5.4.25
hek2mgl: 1.1752531528473 Dave Chen: 0.086159944534302 Josh from Qaribou: 0.49120807647705
Output for 5.4.24
hek2mgl: 1.2564668655396 Dave Chen: 0.084521055221558 Josh from Qaribou: 0.5692150592804
Output for 5.4.23
hek2mgl: 1.3411891460419 Dave Chen: 0.10850405693054 Josh from Qaribou: 0.58354687690735
Output for 5.4.22
hek2mgl: 1.3987121582031 Dave Chen: 0.092225074768066 Josh from Qaribou: 0.61831188201904
Output for 5.4.21
hek2mgl: 1.6068210601807 Dave Chen: 0.098887205123901
Process exited with code 137.
Output for 5.4.20
hek2mgl: 1.3806190490723 Dave Chen: 0.067055940628052 Josh from Qaribou: 0.56611108779907
Output for 5.4.19
hek2mgl: 0.87672090530396 Dave Chen: 0.058340072631836 Josh from Qaribou: 0.41830086708069
Output for 5.4.18
hek2mgl: 1.3042719364166 Dave Chen: 0.072151899337769 Josh from Qaribou: 0.48807501792908
Output for 5.4.17
hek2mgl: 1.4503579139709 Dave Chen: 0.18038010597229
Process exited with code 137.
Output for 5.4.16
hek2mgl: 1.5046360492706 Dave Chen: 0.11158490180969 Josh from Qaribou: 0.73640584945679
Output for 5.4.15
hek2mgl: 1.5831429958344 Dave Chen: 0.11229610443115
Process exited with code 137.
Output for 5.4.14
hek2mgl: 1.9821598529816 Dave Chen: 0.15661597251892
Process exited with code 137.
Output for 5.4.13
hek2mgl: 1.8205029964447 Dave Chen: 0.1006600856781
Process exited with code 137.
Output for 5.4.12
hek2mgl: 1.3642148971558 Dave Chen: 0.068035840988159 Josh from Qaribou: 0.5583930015564
Output for 5.4.11
hek2mgl: 1.311784029007 Dave Chen: 0.089394092559814 Josh from Qaribou: 0.64948081970215
Output for 5.4.10
hek2mgl: 1.5609748363495 Dave Chen: 0.12955284118652
Process exited with code 137.
Output for 5.4.9
hek2mgl: 1.9914259910583 Dave Chen: 0.078679084777832
Process exited with code 137.
Output for 5.4.8
hek2mgl: 1.159677028656 Dave Chen: 0.097908020019531 Josh from Qaribou: 0.46286702156067
Output for 5.4.7
hek2mgl: 1.4692289829254 Dave Chen: 0.079213857650757 Josh from Qaribou: 0.58310079574585
Output for 5.4.6
hek2mgl: 1.452840089798 Dave Chen: 0.070923089981079 Josh from Qaribou: 0.54001307487488
Output for 5.4.5
hek2mgl: 1.2452099323273 Dave Chen: 0.11804509162903 Josh from Qaribou: 0.83411407470703
Output for 5.4.4
hek2mgl: 1.6009449958801 Dave Chen: 0.068989992141724
Process exited with code 137.
Output for 5.4.3
hek2mgl: 1.1159191131592 Dave Chen: 0.090600967407227 Josh from Qaribou: 0.47882413864136
Output for 5.4.2
hek2mgl: 1.486065864563 Dave Chen: 0.07253885269165 Josh from Qaribou: 0.59141993522644
Output for 5.4.1
hek2mgl: 1.1753590106964 Dave Chen: 0.074970960617065 Josh from Qaribou: 0.62549495697021
Output for 5.4.0
hek2mgl: 1.2033941745758 Dave Chen: 0.083792924880981 Josh from Qaribou: 0.4665150642395
Output for 5.3.29
hek2mgl: 0.75075316429138 Dave Chen: 0.04902720451355 Josh from Qaribou: 0.37861204147339
Output for 5.3.28
hek2mgl: 1.0681838989258 Dave Chen: 0.067439794540405 Josh from Qaribou: 0.55514097213745
Output for 5.3.27
hek2mgl: 1.3276190757751 Dave Chen: 0.13302206993103 Josh from Qaribou: 0.61987209320068
Output for 5.3.26
hek2mgl: 1.2124929428101 Dave Chen: 0.07300591468811 Josh from Qaribou: 0.61227011680603
Output for 5.3.25
hek2mgl: 1.2214238643646 Dave Chen: 0.060359954833984 Josh from Qaribou: 0.49979209899902
Output for 5.3.24
hek2mgl: 1.7404930591583 Dave Chen: 0.10737109184265
Process exited with code 137.
Output for 5.3.23
hek2mgl: 1.9283421039581 Dave Chen: 0.071643114089966
Process exited with code 137.
Output for 5.3.22
hek2mgl: 1.6132600307465 Dave Chen: 0.069289922714233
Process exited with code 137.
Output for 5.3.21
hek2mgl: 1.7315971851349 Dave Chen: 0.2071270942688
Process exited with code 137.
Output for 5.3.20
hek2mgl: 1.6294820308685 Dave Chen: 0.10500693321228
Process exited with code 137.
Output for 5.3.19
hek2mgl: 1.4352340698242 Dave Chen: 0.1350519657135 Josh from Qaribou: 0.63021016120911
Output for 5.3.18
hek2mgl: 1.3745110034943 Dave Chen: 0.077642917633057 Josh from Qaribou: 0.63385987281799
Output for 5.3.17
hek2mgl: 1.3403270244598 Dave Chen: 0.063636064529419 Josh from Qaribou: 0.57064294815063
Output for 5.3.16
hek2mgl: 1.2215189933777 Dave Chen: 0.063040971755981 Josh from Qaribou: 0.58257007598877
Output for 5.3.15
hek2mgl: 1.2884109020233 Dave Chen: 0.072147846221924 Josh from Qaribou: 0.57595705986023
Output for 5.3.14
hek2mgl: 1.2143340110779 Dave Chen: 0.05970311164856 Josh from Qaribou: 0.5121328830719
Output for 5.3.13
hek2mgl: 1.1717109680176 Dave Chen: 0.059267997741699 Josh from Qaribou: 0.57303905487061
Output for 5.3.12
hek2mgl: 1.2763319015503 Dave Chen: 0.078366041183472 Josh from Qaribou: 0.53148508071899
Output for 5.3.11
hek2mgl: 0.9229998588562 Dave Chen: 0.082779884338379 Josh from Qaribou: 0.53627681732178
Output for 5.3.10
hek2mgl: 1.2322599887848 Dave Chen: 0.070646047592163 Josh from Qaribou: 0.54486799240112
Output for 5.3.9
hek2mgl: 0.84662103652954 Dave Chen: 0.059141159057617 Josh from Qaribou: 0.5196750164032
Output for 5.3.8
hek2mgl: 1.2236709594727 Dave Chen: 0.068886995315552 Josh from Qaribou: 0.64360189437866
Output for 5.3.7
hek2mgl: 1.3693580627441 Dave Chen: 0.062339067459106 Josh from Qaribou: 0.5378270149231
Output for 5.3.6
hek2mgl: 1.2725670337677 Dave Chen: 0.068924188613892 Josh from Qaribou: 0.58799386024475
Output for 5.3.5
hek2mgl: 0.93126606941223 Dave Chen: 0.056075096130371 Josh from Qaribou: 0.47166895866394
Output for 5.3.4
hek2mgl: 1.2003910541534 Dave Chen: 0.057883977890015 Josh from Qaribou: 0.46963095664978
Output for 5.3.3
hek2mgl: 1.1245930194855 Dave Chen: 0.075593948364258 Josh from Qaribou: 0.51630711555481
Output for 5.3.2
hek2mgl: 1.2370309829712 Dave Chen: 0.10843896865845 Josh from Qaribou: 0.49953603744507
Output for 5.3.1
hek2mgl: 1.1542179584503 Dave Chen: 0.085397958755493 Josh from Qaribou: 0.45165681838989
Output for 5.3.0
hek2mgl: 1.2414650917053 Dave Chen: 0.10045289993286 Josh from Qaribou: 0.44918298721313
Output for 5.2.17
hek2mgl: 1.9001359939575 Dave Chen: 0.097859859466553
Process exited with code 137.
Output for 5.2.16
hek2mgl: 1.8043949604034 Dave Chen: 0.099380970001221
Process exited with code 137.
Output for 5.2.15
hek2mgl: 1.5276660919189 Dave Chen: 0.099640130996704 Josh from Qaribou: 0.60465097427368
Output for 5.2.14
hek2mgl: 1.662223815918 Dave Chen: 0.10146999359131 Josh from Qaribou: 0.5420708656311
Output for 5.2.13
hek2mgl: 1.6232979297638 Dave Chen: 0.094248056411743 Josh from Qaribou: 0.56675910949707
Output for 4.3.2 - 4.3.3, 4.3.5, 4.3.11, 4.4.2, 4.4.4 - 4.4.9, 5.0.1, 5.0.4, 5.1.1 - 5.1.2, 5.1.5 - 5.1.6, 5.2.1 - 5.2.5, 5.2.12

Process exited with code 137.
Output for 5.2.11
hek2mgl: 1.9873750209808 Dave Chen: 0.068179130554199
Process exited with code 137.
Output for 5.2.10
hek2mgl: 1.957456111908 Dave Chen: 0.11556601524353
Process exited with code 137.
Output for 5.2.9
hek2mgl: 1.828901052475 Dave Chen: 0.067107200622559
Process exited with code 137.
Output for 5.2.8
hek2mgl: 1.4780080318451 Dave Chen: 0.072123050689697
Process exited with code 137.
Output for 5.2.7
hek2mgl: 1.7481350898743 Dave Chen: 0.068634033203125
Process exited with code 137.
Output for 5.2.6
hek2mgl: 1.8503179550171 Dave Chen: 0.12118601799011
Process exited with code 137.
Output for 5.2.0
hek2mgl: 1.5300908088684 Dave Chen: 0.055999994277954 Josh from Qaribou: 0.4539999961853
Output for 5.1.4
hek2mgl: 2.2178258895874 Dave Chen: 0.084540843963623
Process exited with code 137.
Output for 5.1.3
hek2mgl: 2.415384054184
Process exited with code 137.
Output for 5.1.0
hek2mgl: 2.4115629196167
Process exited with code 137.
Output for 5.0.5
hek2mgl: 2.3827760219574
Process exited with code 137.
Output for 5.0.3
hek2mgl: 2.4043090343475
Process exited with code 137.
Output for 5.0.2
hek2mgl: 2.2246000766754 Dave Chen: 0.089562892913818
Process exited with code 137.
Output for 5.0.0
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/26cjl on line 16 hek2mgl: 2.2615659236908PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/26cjl on line 28 Dave Chen: 0.10471487045288PHP_EOL
Process exited with code 137.
Output for 4.4.3
hek2mgl: 0.350773 Dave Chen: 0.092597
Process exited with code 137.
Output for 4.4.1
hek2mgl: 0.215835 Dave Chen: 0.091568
Process exited with code 137.
Output for 4.4.0
hek2mgl: 0.439008
Process exited with code 137.
Output for 4.3.10
hek2mgl: 0.149087 Dave Chen: 0.103263
Process exited with code 137.
Output for 4.3.9
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/26cjl on line 16 hek2mgl: 0.428484PHP_EOL
Process exited with code 137.
Output for 4.3.8
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/26cjl on line 16 hek2mgl: 0.371954PHP_EOL
Process exited with code 137.
Output for 4.3.7
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/26cjl on line 16 hek2mgl: 0.455769PHP_EOL
Process exited with code 137.
Output for 4.3.6
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/26cjl on line 16 hek2mgl: 0.208594PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/26cjl on line 28 Dave Chen: 0.0892PHP_EOL
Process exited with code 137.
Output for 4.3.4
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/26cjl on line 16 hek2mgl: 0.405658PHP_EOL
Process exited with code 137.
Output for 4.3.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/26cjl on line 16 hek2mgl: 0.461931PHP_EOL
Process exited with code 137.
Output for 4.3.0
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/26cjl on line 16 hek2mgl: -0.869691PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/26cjl on line 28 Dave Chen: 0.082321PHP_EOL
Process exited with code 137.