3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php /* How many times the code under test should run in each function */ define('LOOP',1000000); function f1() { $var = NULL; for($i=0; $i<LOOP; ++$i) { $var = 'abc'; $var .= ' some other thing '; $var .= ' 123 : 456'; } } function f2() { $var = NULL; for($i=0; $i<LOOP; ++$i) { $var = sprintf('%s%s %d : %d', 'abc', ' some other thing ', 123, 456); } } $start = microtime(true); f1(); $stop = microtime(true); $time1 = $stop - $start; $start = microtime(true); f2(); $stop = microtime(true); $time2 = $stop - $start; echo $time1 . "\t"; echo $time2 . "\n";
based on YTr8Q
Output for 7.1.0
0.088476896286011 0.17206001281738
Output for 7.0.14
0.086801052093506 0.21659994125366
Output for 7.0.6
0.067211866378784 0.11201500892639
Output for 7.0.5
0.065688133239746 0.1114718914032
Output for 7.0.4
0.078872919082642 0.11160707473755
Output for 7.0.3
0.073565006256104 0.12939786911011
Output for 7.0.2
0.067950010299683 0.11242198944092
Output for 7.0.1
0.072733163833618 0.1172239780426
Output for 7.0.0
0.060173988342285 0.11432313919067
Output for 5.6.28
0.12053203582764 -0.029742956161499
Output for 5.6.21
0.08946704864502 0.25306606292725
Output for 5.6.20
0.10287594795227 0.25685501098633
Output for 5.6.19
0.092241048812866 0.24067521095276
Output for 5.6.18
0.08995795249939 0.25054788589478
Output for 5.6.17
0.088690996170044 0.25971508026123
Output for 5.6.16
0.10128498077393 0.25382590293884
Output for 5.6.15
0.10027289390564 0.25304198265076
Output for 5.6.14
0.078947067260742 0.25554800033569
Output for 5.6.13
0.077407121658325 0.24834704399109
Output for 5.6.12
0.083599090576172 0.26169896125793
Output for 5.6.11
0.07854700088501 0.25235795974731
Output for 5.6.10
0.10334205627441 0.25755190849304
Output for 5.6.9
0.092242002487183 0.27987289428711
Output for 5.6.8
0.097131013870239 0.24827289581299
Output for 5.5.35
0.095638990402222 0.25627994537354
Output for 5.5.34
0.080978155136108 0.26625800132751
Output for 5.5.33
0.079670906066895 0.26229381561279
Output for 5.5.32
0.076941013336182 0.25502705574036
Output for 5.5.31
0.094348192214966 0.2658109664917
Output for 5.5.30
0.079503059387207 0.27152299880981
Output for 5.5.29
0.10870099067688 0.27195906639099
Output for 5.5.28
0.099953889846802 0.26557207107544
Output for 5.5.27
0.099238157272339 0.26646399497986
Output for 5.5.26
0.099804878234863 0.26238489151001
Output for 5.5.25
0.0937180519104 0.26242589950562
Output for 5.5.24
0.075028896331787 0.27211809158325
Output for 5.4.45
0.12512588500977 0.43469095230103
Output for 5.4.44
0.21251511573792 0.81971597671509
Output for 5.4.43
0.19555306434631 0.48619198799133
Output for 5.4.42
0.066296100616455 0.57413101196289
Output for 5.4.41
0.12320017814636 0.38093113899231
Output for 5.4.40
0.10646796226501 0.64675188064575
Output for 5.4.39
0.11586904525757 0.49926996231079
Output for 5.4.38
0.16666984558105 0.50606107711792
Output for 5.4.37
0.11957502365112 0.45075798034668
Output for 5.4.36
0.12474298477173 0.45388197898865
Output for 5.4.35
0.12754011154175 0.43869495391846
Output for 5.4.34
0.13817501068115 0.44467210769653
Output for 5.4.32
0.083251953125 0.33089399337769
Output for 5.4.31
0.11967587471008 0.34583306312561
Output for 5.4.30
0.10216999053955 0.36886096000671
Output for 5.4.29
0.088496923446655 0.34362387657166
Output for 5.4.28
0.089889049530029 0.35771894454956
Output for 5.4.27
0.090204000473022 0.36636400222778
Output for 5.4.26
0.086124897003174 0.35665512084961
Output for 5.4.25
0.089133977890015 0.38450694084167
Output for 5.4.24
0.10001611709595 0.35407400131226
Output for 5.4.23
0.13193011283875 0.34217214584351
Output for 5.4.22
0.10459804534912 0.45272493362427
Output for 5.4.21
0.098613977432251 0.34497714042664
Output for 5.4.20
0.10721802711487 0.35756301879883
Output for 5.4.19
0.090789794921875 0.33813905715942
Output for 5.4.18
0.08981990814209 0.34043717384338
Output for 5.4.17
0.087556123733521 0.33161091804504
Output for 5.4.16
0.13212394714355 0.38190412521362
Output for 5.4.15
0.088948011398315 0.33257818222046
Output for 5.4.14
0.15422487258911 0.35107111930847
Output for 5.4.13
0.085602045059204 0.36855411529541
Output for 5.4.12
0.10938501358032 0.37815690040588
Output for 5.4.11
0.092557907104492 0.36858201026917
Output for 5.4.10
0.10981678962708 0.34283399581909
Output for 5.4.9
0.099287986755371 0.36547589302063
Output for 5.4.8
0.10606503486633 0.35371994972229
Output for 5.4.7
0.09157919883728 0.34515619277954
Output for 5.4.6
0.10696601867676 0.38086891174316
Output for 5.4.5
0.093334913253784 0.34149599075317
Output for 5.4.4
0.10429716110229 0.33990287780762
Output for 5.4.3
0.091583967208862 0.36283993721008
Output for 5.4.2
0.089601039886475 0.40296006202698
Output for 5.4.1
0.093453168869019 0.34981322288513
Output for 5.4.0
0.10611391067505 0.33975505828857
Output for 5.3.29
0.15148997306824 0.40827798843384
Output for 5.3.28
0.16407895088196 0.5202009677887
Output for 5.3.27
0.14740610122681 0.44369196891785
Output for 5.3.26
0.14342403411865 0.43841695785522
Output for 5.3.25
0.14778995513916 0.49198794364929
Output for 5.3.24
0.14760589599609 0.42626285552979
Output for 5.3.23
0.14263606071472 0.40997982025146
Output for 5.3.22
0.12602496147156 0.44242000579834
Output for 5.3.21
0.12882804870605 0.41013503074646
Output for 5.3.20
0.13229990005493 0.41469311714172
Output for 5.3.19
0.145427942276 0.46917295455933
Output for 5.3.18
0.13359308242798 0.41369700431824
Output for 5.3.17
0.13357901573181 0.44508099555969
Output for 5.3.16
0.13418984413147 0.41564011573792
Output for 5.3.15
0.12826704978943 0.42928814888
Output for 5.3.14
0.15385103225708 0.43844890594482
Output for 5.3.13
0.1358380317688 0.41700196266174
Output for 5.3.12
0.13562893867493 0.42919707298279
Output for 5.3.11
0.13396906852722 0.43868708610535
Output for 5.3.10
0.12518310546875 0.40467309951782
Output for 5.3.9
0.12507390975952 0.42440819740295
Output for 5.3.8
0.12413907051086 0.468829870224
Output for 5.3.7
0.12979793548584 0.47738409042358
Output for 5.3.6
0.12566494941711 0.45958495140076
Output for 5.3.5
0.12558794021606 0.43858289718628
Output for 5.3.4
0.12211084365845 0.42812299728394
Output for 5.3.3
0.12204098701477 0.43917012214661
Output for 5.3.2
0.14592504501343 0.42575001716614
Output for 5.3.1
0.12708711624146 0.41297698020935
Output for 5.3.0
0.1474449634552 0.43221998214722
Output for 5.2.17
0.17181301116943 0.4399950504303
Output for 5.2.16
0.16447615623474 0.4767439365387
Output for 5.2.15
0.16547513008118 0.4422459602356
Output for 5.2.14
0.16783094406128 0.53391098976135
Output for 5.2.13
0.17976903915405 0.44882702827454
Output for 5.2.12
0.18452501296997 0.47898387908936
Output for 5.2.11
0.17408204078674 0.44852709770203
Output for 5.2.10
0.16907715797424 0.45487117767334
Output for 5.2.9
0.17168784141541 0.45145010948181
Output for 5.2.8
0.17554807662964 0.45037198066711
Output for 5.2.7
0.17197799682617 0.48475909233093
Output for 5.2.6
0.18469214439392 0.41695713996887
Output for 5.2.5
0.1782431602478 0.47992300987244
Output for 5.2.4
0.20083594322205 0.45218300819397
Output for 5.2.3
0.17051076889038 0.46465015411377
Output for 5.2.2
0.18579292297363 0.45621991157532
Output for 5.2.1
0.23087096214294 0.65977787971497
Output for 5.2.0
0.20991992950439 0.64568114280701
Output for 5.1.6
0.2660801410675 0.49082708358765
Output for 5.1.5
0.25367593765259 0.51407098770142
Output for 5.1.4
0.26731085777283 0.50101709365845
Output for 5.1.3
0.24970316886902 0.45609307289124
Output for 5.1.2
0.24606084823608 0.50120306015015
Output for 5.1.1
0.24966406822205 0.49774384498596
Output for 5.1.0
0.25018095970154 0.49102091789246
Output for 5.0.5
0.42511606216431 0.60516381263733
Output for 5.0.4
0.42256212234497 0.75655221939087
Output for 5.0.3
0.40285611152649 0.63790988922119
Output for 5.0.2
0.45480108261108 0.58482909202576
Output for 5.0.1
0.50730800628662 0.66113901138306
Output for 5.0.0
0.43299078941345 0.67170715332031
Output for 4.4.9
0.440218 -0.28106
Output for 4.4.8
0.444512 -0.321076
Output for 4.4.7
0.408959 -0.347062
Output for 4.4.6
0.491642 -0.310763
Output for 4.4.5
-0.550015 0.654834
Output for 4.4.4
-0.562703 0.670994
Output for 4.4.3
-0.581316 0.639939
Output for 4.4.2
-0.587548 -0.326926
Output for 4.4.1
0.416943 -0.39085
Output for 4.4.0
0.428369 -0.213663
Output for 4.3.11
0.426882 -0.30403
Output for 4.3.10
0.432952 -0.314533
Output for 4.3.9
-0.573377 0.712114
Output for 4.3.8
-0.586812 -0.257203
Output for 4.3.7
0.588626 -0.188356
Output for 4.3.6
-0.453354 0.733348
Output for 4.3.5
-0.581233 0.705629
Output for 4.3.4
-0.580526 -0.345038
Output for 4.3.3
0.469125 -0.176714
Output for 4.3.2
0.460412 -0.345789
Output for 4.3.1
0.398932 -0.336152
Output for 4.3.0
-0.354668 0.19106