3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $starttime = microtime(true); $sArr = array(); for ($i = 0; $i < 30000; $i++) { $sArr[] = 'String concatenation. ' . $i; } $str = implode('', $sArr); $x = md5($str); $endtime = microtime(true); print "array append & implode: " . ($endtime - $starttime) . " s\n" ; // standard string append $starttime = microtime(true); $str = ''; for ($i = 0; $i < 30000; $i++) { $str .= 'String concatenation. ' . $i; } $x = md5($str); unset($str); $endtime = microtime(true); print "string concat: " . ($endtime - $starttime) . " s\n" ; $starttime = microtime(true); $sArr = array(); for ($i = 0; $i < 30000; $i++) { $sArr[] = 'String concatenation. ' . $i; } $str = implode('', $sArr); $x = md5($str); $endtime = microtime(true); print "array append & implode: " . ($endtime - $starttime) . " s\n" ;
Output for 7.1.0
array append & implode: 0.0050530433654785 s string concat: 0.004525899887085 s array append & implode: 0.0048389434814453 s
Output for 7.0.14
array append & implode: 0.0058190822601318 s string concat: 0.0051379203796387 s array append & implode: 0.0054528713226318 s
Output for 7.0.12
array append & implode: 0.0065948963165283 s string concat: 0.0055809020996094 s array append & implode: 0.0060138702392578 s
Output for 7.0.6
array append & implode: 0.0044889450073242 s string concat: 0.0034430027008057 s array append & implode: 0.0038189888000488 s
Output for 7.0.5
array append & implode: 0.0061700344085693 s string concat: 0.0045812129974365 s array append & implode: 0.00496506690979 s
Output for 7.0.4
array append & implode: 0.0057241916656494 s string concat: 0.0049459934234619 s array append & implode: 0.0052928924560547 s
Output for 7.0.3
array append & implode: 0.0038418769836426 s string concat: 0.0032391548156738 s array append & implode: 0.0036880970001221 s
Output for 7.0.2
array append & implode: 0.0055170059204102 s string concat: 0.0048060417175293 s array append & implode: 0.0050139427185059 s
Output for 7.0.1
array append & implode: 0.0043540000915527 s string concat: 0.0034680366516113 s array append & implode: 0.00406813621521 s
Output for 7.0.0
array append & implode: 0.0047421455383301 s string concat: 0.003856897354126 s array append & implode: 0.0043199062347412 s
Output for hhvm-3.12.0
array append & implode: 0.010606050491333 s string concat: 0.01073694229126 s array append & implode: 0.0062630176544189 s
Output for hhvm-3.10.0
array append & implode: 0.0073809623718262 s string concat: 0.0058090686798096 s array append & implode: 0.0058801174163818 s
Output for 5.6.28
array append & implode: 0.014791965484619 s string concat: 0.0092511177062988 s array append & implode: 0.014999151229858 s
Output for 5.6.21
array append & implode: 0.013727903366089 s string concat: 0.0076501369476318 s array append & implode: 0.013324022293091 s
Output for 5.6.20
array append & implode: 0.0089998245239258 s string concat: 0.0051438808441162 s array append & implode: 0.0099060535430908 s
Output for 5.6.19
array append & implode: 0.01311993598938 s string concat: 0.0070610046386719 s array append & implode: 0.013757944107056 s
Output for 5.6.18
array append & implode: 0.0086619853973389 s string concat: 0.0052189826965332 s array append & implode: 0.0093460083007812 s
Output for 5.6.17
array append & implode: 0.010406970977783 s string concat: 0.0059487819671631 s array append & implode: 0.010445117950439 s
Output for 5.6.16
array append & implode: 0.011093854904175 s string concat: 0.0065450668334961 s array append & implode: 0.011189937591553 s
Output for 5.6.15
array append & implode: 0.012608051300049 s string concat: 0.007343053817749 s array append & implode: 0.01255202293396 s
Output for 5.6.14
array append & implode: 0.013355016708374 s string concat: 0.0075340270996094 s array append & implode: 0.012955904006958 s
Output for 5.6.13
array append & implode: 0.012814044952393 s string concat: 0.0073897838592529 s array append & implode: 0.012624979019165 s
Output for 5.6.12
array append & implode: 0.011915922164917 s string concat: 0.0067980289459229 s array append & implode: 0.011690139770508 s
Output for 5.6.11
array append & implode: 0.013152122497559 s string concat: 0.0072150230407715 s array append & implode: 0.012814998626709 s
Output for 5.6.10
array append & implode: 0.011798858642578 s string concat: 0.0069320201873779 s array append & implode: 0.011751890182495 s
Output for 5.6.9
array append & implode: 0.01152515411377 s string concat: 0.0067269802093506 s array append & implode: 0.011631011962891 s
Output for 5.6.8
array append & implode: 0.012839794158936 s string concat: 0.0071778297424316 s array append & implode: 0.012611150741577 s
Output for 5.5.35
array append & implode: 0.011713981628418 s string concat: 0.0069370269775391 s array append & implode: 0.011569976806641 s
Output for 5.5.34
array append & implode: 0.0084230899810791 s string concat: 0.0050191879272461 s array append & implode: 0.009160041809082 s
Output for 5.5.33
array append & implode: 0.010593891143799 s string concat: 0.006289005279541 s array append & implode: 0.011399984359741 s
Output for 5.5.32
array append & implode: 0.010758876800537 s string concat: 0.0069820880889893 s array append & implode: 0.010285139083862 s
Output for 5.5.31
array append & implode: 0.0089120864868164 s string concat: 0.0052440166473389 s array append & implode: 0.0093140602111816 s
Output for 5.5.30
array append & implode: 0.009843111038208 s string concat: 0.0055880546569824 s array append & implode: 0.0098631381988525 s
Output for 5.5.29
array append & implode: 0.014076948165894 s string concat: 0.0076780319213867 s array append & implode: 0.011388063430786 s
Output for 5.5.28
array append & implode: 0.0098810195922852 s string concat: 0.0055840015411377 s array append & implode: 0.0098421573638916 s
Output for 5.5.27
array append & implode: 0.013676881790161 s string concat: 0.0075809955596924 s array append & implode: 0.013126850128174 s
Output for 5.5.26
array append & implode: 0.013630867004395 s string concat: 0.007375955581665 s array append & implode: 0.012797117233276 s
Output for 5.5.25
array append & implode: 0.013230085372925 s string concat: 0.0074210166931152 s array append & implode: 0.012900829315186 s
Output for 5.5.24
array append & implode: 0.014683961868286 s string concat: 0.0077309608459473 s array append & implode: 0.013236045837402 s
Output for 5.4.45
array append & implode: 0.008760929107666 s string concat: 0.0052180290222168 s array append & implode: 0.0094130039215088 s
Output for 5.4.44
array append & implode: 0.012609004974365 s string concat: 0.0075068473815918 s array append & implode: 0.012966156005859 s
Output for 5.4.43
array append & implode: 0.011561870574951 s string concat: 0.0066092014312744 s array append & implode: 0.01161003112793 s
Output for 5.4.42
array append & implode: 0.0087950229644775 s string concat: 0.0050568580627441 s array append & implode: 0.009166955947876 s
Output for 5.4.41
array append & implode: 0.009357213973999 s string concat: 0.005079984664917 s array append & implode: 0.009566068649292 s
Output for 5.4.40
array append & implode: 0.0084748268127441 s string concat: 0.0049998760223389 s array append & implode: 0.010540008544922 s
Output for 5.4.39
array append & implode: 0.013247966766357 s string concat: 0.0075881481170654 s array append & implode: 0.013036012649536 s
Output for 5.4.38
array append & implode: 0.0087001323699951 s string concat: 0.0051119327545166 s array append & implode: 0.0090401172637939 s
Output for 5.4.37
array append & implode: 0.01353907585144 s string concat: 0.0077600479125977 s array append & implode: 0.013247966766357 s
Output for 5.4.36
array append & implode: 0.013617038726807 s string concat: 0.007584810256958 s array append & implode: 0.013228178024292 s
Output for 5.4.35
array append & implode: 0.013679981231689 s string concat: 0.0069260597229004 s array append & implode: 0.011283159255981 s
Output for 5.4.34
array append & implode: 0.0086438655853271 s string concat: 0.0049710273742676 s array append & implode: 0.00913405418396 s
Output for 5.4.32
array append & implode: 0.013266086578369 s string concat: 0.0076701641082764 s array append & implode: 0.013046979904175 s
Output for 5.4.31
array append & implode: 0.013447046279907 s string concat: 0.0076699256896973 s array append & implode: 0.013116836547852 s
Output for 5.4.30
array append & implode: 0.013679981231689 s string concat: 0.008181095123291 s array append & implode: 0.013489961624146 s
Output for 5.4.29
array append & implode: 0.009274959564209 s string concat: 0.0057928562164307 s array append & implode: 0.0095441341400146 s
Output for 5.4.28
array append & implode: 0.013822078704834 s string concat: 0.0081779956817627 s array append & implode: 0.013416051864624 s
Output for 5.4.27
array append & implode: 0.013024806976318 s string concat: 0.0075860023498535 s array append & implode: 0.012934923171997 s
Output for 5.4.26
array append & implode: 0.0088598728179932 s string concat: 0.0051770210266113 s array append & implode: 0.0093989372253418 s
Output for 5.4.25
array append & implode: 0.013134956359863 s string concat: 0.0076439380645752 s array append & implode: 0.013117074966431 s
Output for 5.4.24
array append & implode: 0.011286973953247 s string concat: 0.0063278675079346 s array append & implode: 0.0091478824615479 s
Output for 5.4.23
array append & implode: 0.0096781253814697 s string concat: 0.0056231021881104 s array append & implode: 0.0099070072174072 s
Output for 5.4.22
array append & implode: 0.013144016265869 s string concat: 0.007702112197876 s array append & implode: 0.01296591758728 s
Output for 5.4.21
array append & implode: 0.01264500617981 s string concat: 0.0076510906219482 s array append & implode: 0.012686014175415 s
Output for 5.4.20
array append & implode: 0.011708974838257 s string concat: 0.0064170360565186 s array append & implode: 0.011680126190186 s
Output for 5.4.19
array append & implode: 0.012432098388672 s string concat: 0.0069849491119385 s array append & implode: 0.012198925018311 s
Output for 5.4.18
array append & implode: 0.009185791015625 s string concat: 0.0051589012145996 s array append & implode: 0.0093700885772705 s
Output for 5.4.17
array append & implode: 0.013878107070923 s string concat: 0.0078639984130859 s array append & implode: 0.01361083984375 s
Output for 5.4.16
array append & implode: 0.013267040252686 s string concat: 0.0077171325683594 s array append & implode: 0.01322603225708 s
Output for 5.4.15
array append & implode: 0.0087270736694336 s string concat: 0.0050010681152344 s array append & implode: 0.0091300010681152 s
Output for 5.4.14
array append & implode: 0.0088541507720947 s string concat: 0.0050699710845947 s array append & implode: 0.0093538761138916 s
Output for 5.4.13
array append & implode: 0.012175798416138 s string concat: 0.0068130493164062 s array append & implode: 0.012087106704712 s
Output for 5.4.12
array append & implode: 0.014317989349365 s string concat: 0.0081741809844971 s array append & implode: 0.014247894287109 s
Output for 5.4.11
array append & implode: 0.012952089309692 s string concat: 0.0073859691619873 s array append & implode: 0.012711048126221 s
Output for 5.4.10
array append & implode: 0.012217044830322 s string concat: 0.0067260265350342 s array append & implode: 0.012014150619507 s
Output for 5.4.9
array append & implode: 0.013696908950806 s string concat: 0.0078630447387695 s array append & implode: 0.013429880142212 s
Output for 5.4.8
array append & implode: 0.012187957763672 s string concat: 0.0067448616027832 s array append & implode: 0.012201070785522 s
Output for 5.4.7
array append & implode: 0.013821125030518 s string concat: 0.007753849029541 s array append & implode: 0.013550043106079 s
Output for 5.4.6
array append & implode: 0.013143062591553 s string concat: 0.0076618194580078 s array append & implode: 0.012872219085693 s
Output for 5.4.5
array append & implode: 0.013511896133423 s string concat: 0.0080878734588623 s array append & implode: 0.01344895362854 s
Output for 5.4.4
array append & implode: 0.011764049530029 s string concat: 0.0068249702453613 s array append & implode: 0.011730194091797 s
Output for 5.4.3
array append & implode: 0.013365030288696 s string concat: 0.0079941749572754 s array append & implode: 0.013070106506348 s
Output for 5.4.2
array append & implode: 0.013686895370483 s string concat: 0.0071470737457275 s array append & implode: 0.012351989746094 s
Output for 5.4.1
array append & implode: 0.0098390579223633 s string concat: 0.0058779716491699 s array append & implode: 0.010645866394043 s
Output for 5.4.0
array append & implode: 0.013422012329102 s string concat: 0.0076761245727539 s array append & implode: 0.013267993927002 s
Output for 5.3.29
array append & implode: 0.013150930404663 s string concat: 0.0075180530548096 s array append & implode: 0.011268854141235 s
Output for 5.3.28
array append & implode: 0.011583089828491 s string concat: 0.0065100193023682 s array append & implode: 0.010144948959351 s
Output for 5.3.27
array append & implode: 0.014357805252075 s string concat: 0.0078029632568359 s array append & implode: 0.012125015258789 s
Output for 5.3.26
array append & implode: 0.014286041259766 s string concat: 0.0078740119934082 s array append & implode: 0.012098073959351 s
Output for 5.3.25
array append & implode: 0.011281967163086 s string concat: 0.0062761306762695 s array append & implode: 0.008685827255249 s
Output for 5.3.24
array append & implode: 0.0091609954833984 s string concat: 0.0051529407501221 s array append & implode: 0.0083670616149902 s
Output for 5.3.23
array append & implode: 0.012694120407104 s string concat: 0.0068161487579346 s array append & implode: 0.01073694229126 s
Output for 5.3.22
array append & implode: 0.014065027236938 s string concat: 0.0078840255737305 s array append & implode: 0.012081146240234 s
Output for 5.3.21
array append & implode: 0.014524936676025 s string concat: 0.0079560279846191 s array append & implode: 0.012372016906738 s
Output for 5.3.20
array append & implode: 0.014603137969971 s string concat: 0.0082499980926514 s array append & implode: 0.012854099273682 s
Output for 5.3.19
array append & implode: 0.0140540599823 s string concat: 0.0078110694885254 s array append & implode: 0.01199197769165 s
Output for 5.3.18
array append & implode: 0.014379024505615 s string concat: 0.0078279972076416 s array append & implode: 0.012209892272949 s
Output for 5.3.17
array append & implode: 0.013784170150757 s string concat: 0.0077929496765137 s array append & implode: 0.011960029602051 s
Output for 5.3.16
array append & implode: 0.014664173126221 s string concat: 0.0081639289855957 s array append & implode: 0.012588977813721 s
Output for 5.3.15
array append & implode: 0.013293981552124 s string concat: 0.0075280666351318 s array append & implode: 0.011471033096313 s
Output for 5.3.14
array append & implode: 0.011605978012085 s string concat: 0.0066778659820557 s array append & implode: 0.010329961776733 s
Output for 5.3.13
array append & implode: 0.014073133468628 s string concat: 0.0079829692840576 s array append & implode: 0.01214599609375 s
Output for 5.3.12
array append & implode: 0.013554096221924 s string concat: 0.0080349445343018 s array append & implode: 0.011860132217407 s
Output for 5.3.11
array append & implode: 0.011439085006714 s string concat: 0.0068340301513672 s array append & implode: 0.010101079940796 s
Output for 5.3.10
array append & implode: 0.00897216796875 s string concat: 0.0052590370178223 s array append & implode: 0.0084550380706787 s
Output for 5.3.9
array append & implode: 0.01103401184082 s string concat: 0.0060498714447021 s array append & implode: 0.0092501640319824 s
Output for 5.3.8
array append & implode: 0.013887882232666 s string concat: 0.0077738761901855 s array append & implode: 0.012136936187744 s
Output for 5.3.7
array append & implode: 0.014202117919922 s string concat: 0.0080499649047852 s array append & implode: 0.010586023330688 s
Output for 5.3.6
array append & implode: 0.011190891265869 s string concat: 0.0061881542205811 s array append & implode: 0.0099930763244629 s
Output for 5.3.5
array append & implode: 0.0092911720275879 s string concat: 0.0052661895751953 s array append & implode: 0.0084950923919678 s
Output for 5.3.4
array append & implode: 0.014015197753906 s string concat: 0.0078659057617188 s array append & implode: 0.012327909469604 s
Output for 5.3.3
array append & implode: 0.014494180679321 s string concat: 0.0082008838653564 s array append & implode: 0.012569904327393 s
Output for 5.3.2
array append & implode: 0.014045000076294 s string concat: 0.0080921649932861 s array append & implode: 0.012299060821533 s
Output for 5.3.1
array append & implode: 0.014573097229004 s string concat: 0.0071418285369873 s array append & implode: 0.01154088973999 s
Output for 5.3.0
array append & implode: 0.014281034469604 s string concat: 0.0080959796905518 s array append & implode: 0.012405872344971 s
Output for 5.2.17
array append & implode: 0.012655019760132 s string concat: 0.0074021816253662 s array append & implode: 0.011348009109497 s
Output for 5.2.16
array append & implode: 0.0096888542175293 s string concat: 0.0059850215911865 s array append & implode: 0.0092549324035645 s
Output for 5.2.15
array append & implode: 0.016275882720947 s string concat: 0.0093419551849365 s array append & implode: 0.014029979705811 s
Output for 5.2.14
array append & implode: 0.014764070510864 s string concat: 0.0089430809020996 s array append & implode: 0.013077020645142 s
Output for 5.2.13
array append & implode: 0.016613960266113 s string concat: 0.0095510482788086 s array append & implode: 0.014244079589844 s
Output for 5.2.12
array append & implode: 0.015990018844604 s string concat: 0.0091888904571533 s array append & implode: 0.013674974441528 s
Output for 5.2.11
array append & implode: 0.016512155532837 s string concat: 0.0095999240875244 s array append & implode: 0.014203071594238 s
Output for 5.2.10
array append & implode: 0.016546964645386 s string concat: 0.008458137512207 s array append & implode: 0.012678861618042 s
Output for 5.2.9
array append & implode: 0.012764930725098 s string concat: 0.007390022277832 s array append & implode: 0.011420011520386 s
Output for 5.2.8
array append & implode: 0.015413999557495 s string concat: 0.0090181827545166 s array append & implode: 0.013472080230713 s
Output for 5.2.7
array append & implode: 0.0154869556427 s string concat: 0.0090429782867432 s array append & implode: 0.01350998878479 s
Output for 5.2.6
array append & implode: 0.017673969268799 s string concat: 0.010376214981079 s array append & implode: 0.015017032623291 s
Output for 5.2.5
array append & implode: 0.020831108093262 s string concat: 0.010139942169189 s array append & implode: 0.018160820007324 s
Output for 5.2.4
array append & implode: 0.01884913444519 s string concat: 0.0098311901092529 s array append & implode: 0.017351865768433 s
Output for 5.2.3
array append & implode: 0.017351150512695 s string concat: 0.0087211132049561 s array append & implode: 0.015934228897095 s
Output for 5.2.2
array append & implode: 0.011948108673096 s string concat: 0.0063869953155518 s array append & implode: 0.011476039886475 s
Output for 5.2.1
array append & implode: 0.017491817474365 s string concat: 0.011914014816284 s array append & implode: 0.014317989349365 s
Output for 5.2.0
array append & implode: 0.017788171768188 s string concat: 0.011522054672241 s array append & implode: 0.014281988143921 s
Output for 5.1.6
array append & implode: 0.028960943222046 s string concat: 0.014417171478271 s array append & implode: 0.02222204208374 s
Output for 5.1.5
array append & implode: 0.017455816268921 s string concat: 0.0086839199066162 s array append & implode: 0.015316009521484 s
Output for 5.1.4
array append & implode: 0.029330968856812 s string concat: 0.013739109039307 s array append & implode: 0.022845983505249 s
Output for 5.1.3
array append & implode: 0.023407936096191 s string concat: 0.011512994766235 s array append & implode: 0.018206834793091 s
Output for 5.1.2
array append & implode: 0.02790379524231 s string concat: 0.011162042617798 s array append & implode: 0.020928144454956 s
Output for 5.1.1
array append & implode: 0.020407915115356 s string concat: 0.010660171508789 s array append & implode: 0.015745162963867 s
Output for 5.1.0
array append & implode: 0.017583131790161 s string concat: 0.010398864746094 s array append & implode: 0.016098976135254 s
Output for 5.0.5
array append & implode: 0.020900964736938 s string concat: 0.011364221572876 s array append & implode: 0.018449068069458 s
Output for 5.0.4
array append & implode: 0.032764911651611 s string concat: 0.017863988876343 s array append & implode: 0.02543306350708 s
Output for 5.0.3
array append & implode: 0.031290054321289 s string concat: 0.015291929244995 s array append & implode: 0.024272918701172 s
Output for 5.0.2
array append & implode: 0.028307914733887 s string concat: 0.015089988708496 s array append & implode: 0.023357152938843 s
Output for 5.0.1
array append & implode: 0.034242868423462 s string concat: 0.018338203430176 s array append & implode: 0.026169061660767 s
Output for 5.0.0
array append & implode: 0.030184984207153 s string concat: 0.015860795974731 s array append & implode: 0.0243239402771 s
Output for 4.4.9
array append & implode: 0.037552 s string concat: 0.017628 s array append & implode: 0.029016 s
Output for 4.4.8
array append & implode: 0.035659 s string concat: 0.015051 s array append & implode: 0.025525 s
Output for 4.4.7
array append & implode: 0.039415 s string concat: 0.019798 s array append & implode: 0.03186 s
Output for 4.4.6
array append & implode: 0.039739 s string concat: 0.018391 s array append & implode: -0.96836 s
Output for 4.4.5
array append & implode: 0.04054 s string concat: 0.018966 s array append & implode: 0.030475 s
Output for 4.4.4
array append & implode: 0.036376 s string concat: 0.017039 s array append & implode: 0.028578 s
Output for 4.4.3
array append & implode: 0.037908 s string concat: 0.017563 s array append & implode: 0.029246 s
Output for 4.4.2
array append & implode: 0.026382 s string concat: 0.012554 s array append & implode: 0.025004 s
Output for 4.4.1
array append & implode: 0.037273 s string concat: 0.017264 s array append & implode: 0.029519 s
Output for 4.4.0
array append & implode: 0.035589 s string concat: 0.014104 s array append & implode: 0.024475 s
Output for 4.3.11
array append & implode: 0.036137 s string concat: 0.017048 s array append & implode: 0.028998 s
Output for 4.3.10
array append & implode: 0.023144 s string concat: 0.012271 s array append & implode: 0.021876 s
Output for 4.3.9
array append & implode: 0.037387 s string concat: 0.013257 s array append & implode: 0.025979 s
Output for 4.3.8
array append & implode: 0.038194 s string concat: 0.017409 s array append & implode: 0.029404 s
Output for 4.3.7
array append & implode: 0.028469 s string concat: 0.014677 s array append & implode: 0.023827 s
Output for 4.3.6
array append & implode: 0.030033 s string concat: 0.014506 s array append & implode: 0.025052 s
Output for 4.3.5
array append & implode: 0.038317 s string concat: 0.017887 s array append & implode: 0.029757 s
Output for 4.3.4
array append & implode: 0.037746 s string concat: 0.014858 s array append & implode: 0.027253 s
Output for 4.3.3
array append & implode: 0.040175 s string concat: 0.018086 s array append & implode: 0.030493 s
Output for 4.3.2
array append & implode: 0.039999 s string concat: 0.018328 s array append & implode: 0.025464 s
Output for 4.3.1
array append & implode: 0.032775 s string concat: 0.017444 s array append & implode: 0.026037 s
Output for 4.3.0
array append & implode: 0.03296 s string concat: 0.017744 s array append & implode: 0.026527 s