3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $iterations = 500000; $name = 'Tom'; $date = '13/09/2009'; $t1 = microtime(true); for ($i = 0; $i < $iterations; $i++) { $str = sprintf('Hi %s, you last logged in on %s.', $name, $date); } $t2 = microtime(true); echo 'sprintf: ' . ($t2-$t1); echo '<br />'; $t1 = microtime(true); for ($i = 0; $i < $iterations; $i++) { $str = 'Hi ' . $name . ', you last logged in on ' . $date; } $t2 = microtime(true); echo 'concat: ' . ($t2-$t1); echo '<br />';
Output for 7.1.0
sprintf: 0.089982032775879<br />concat: 0.043910980224609<br />
Output for 7.0.14
sprintf: 0.091042041778564<br />concat: 0.04991602897644<br />
Output for 7.0.10
sprintf: 0.07208514213562<br />concat: 0.036545991897583<br />
Output for 7.0.9
sprintf: 0.081337928771973<br />concat: 0.039881944656372<br />
Output for 7.0.8
sprintf: 0.057316064834595<br />concat: 0.03531813621521<br />
Output for 7.0.7
sprintf: 0.06157398223877<br />concat: 0.034319877624512<br />
Output for 7.0.6
sprintf: 0.063260078430176<br />concat: 0.03695011138916<br />
Output for 7.0.5
sprintf: 0.076895952224731<br />concat: 0.036103963851929<br />
Output for 7.0.4
sprintf: 0.064060926437378<br />concat: 0.036402940750122<br />
Output for 7.0.3
sprintf: 0.065418004989624<br />concat: 0.034662008285522<br />
Output for 7.0.2
sprintf: 0.069634914398193<br />concat: 0.033791065216064<br />
Output for 7.0.1
sprintf: 0.067337989807129<br />concat: 0.034674882888794<br />
Output for 7.0.0
sprintf: 0.062562942504883<br />concat: 0.03559684753418<br />
Output for 5.6.28
sprintf: 0.057828903198242<br />concat: -0.060052871704102<br />
Output for 5.6.25
sprintf: 0.12396907806396<br />concat: 0.049817085266113<br />
Output for 5.6.24
sprintf: 0.1237530708313<br />concat: 0.047619104385376<br />
Output for 5.6.23
sprintf: 0.11397004127502<br />concat: 0.047414064407349<br />
Output for 5.6.22
sprintf: 0.13537192344666<br />concat: 0.046093940734863<br />
Output for 5.6.21
sprintf: 0.11880803108215<br />concat: 0.046196937561035<br />
Output for 5.6.20
sprintf: 0.11521291732788<br />concat: 0.045834064483643<br />
Output for 5.6.19
sprintf: 0.12109112739563<br />concat: 0.047044992446899<br />
Output for 5.6.18
sprintf: 0.13620209693909<br />concat: 0.046633005142212<br />
Output for 5.6.17
sprintf: 0.1310019493103<br />concat: 0.047646999359131<br />
Output for 5.6.16
sprintf: 0.10973405838013<br />concat: 0.046917915344238<br />
Output for 5.6.15
sprintf: 0.12316989898682<br />concat: 0.049658060073853<br />
Output for 5.6.14
sprintf: 0.12749600410461<br />concat: 0.047847032546997<br />
Output for 5.6.13
sprintf: 0.11621189117432<br />concat: 0.047311067581177<br />
Output for 5.6.12
sprintf: 0.12652182579041<br />concat: 0.047658920288086<br />
Output for 5.6.11
sprintf: 0.13389110565186<br />concat: 0.047980070114136<br />
Output for 5.6.10
sprintf: 0.12477612495422<br />concat: 0.046772003173828<br />
Output for 5.6.9
sprintf: 0.14773988723755<br />concat: 0.047667026519775<br />
Output for 5.6.8
sprintf: 0.11624312400818<br />concat: 0.043893098831177<br />
Output for 5.6.7
sprintf: 0.12389993667603<br />concat: 0.049158096313477<br />
Output for 5.6.6
sprintf: 0.12856197357178<br />concat: 0.043691158294678<br />
Output for 5.6.5
sprintf: 0.12739896774292<br />concat: 0.043669939041138<br />
Output for 5.6.4
sprintf: 0.13276600837708<br />concat: 0.04383397102356<br />
Output for 5.6.3
sprintf: 0.14901804924011<br />concat: 0.044907093048096<br />
Output for 5.6.2
sprintf: 0.11999177932739<br />concat: 0.044064044952393<br />
Output for 5.6.1
sprintf: 0.12412691116333<br />concat: 0.043715000152588<br />
Output for 5.6.0
sprintf: 0.1306209564209<br />concat: 0.043401002883911<br />
Output for 5.5.38
sprintf: 0.13376998901367<br />concat: 0.048067092895508<br />
Output for 5.5.37
sprintf: 0.13371920585632<br />concat: 0.047811031341553<br />
Output for 5.5.36
sprintf: 0.15065598487854<br />concat: 0.046868801116943<br />
Output for 5.5.35
sprintf: 0.15457010269165<br />concat: 0.064712047576904<br />
Output for 5.5.34
sprintf: 0.13543105125427<br />concat: 0.046816110610962<br />
Output for 5.5.33
sprintf: 0.13450717926025<br />concat: 0.046957015991211<br />
Output for 5.5.32
sprintf: 0.11651396751404<br />concat: 0.04645299911499<br />
Output for 5.5.31
sprintf: 0.13171982765198<br />concat: 0.04820990562439<br />
Output for 5.5.30
sprintf: 0.12292504310608<br />concat: 0.047564029693604<br />
Output for 5.5.29
sprintf: 0.12916612625122<br />concat: 0.047539949417114<br />
Output for 5.5.28
sprintf: 0.12371706962585<br />concat: 0.0468590259552<br />
Output for 5.5.27
sprintf: 0.12558007240295<br />concat: 0.048467874526978<br />
Output for 5.5.26
sprintf: 0.11504697799683<br />concat: 0.046813011169434<br />
Output for 5.5.25
sprintf: 0.13031792640686<br />concat: 0.048182010650635<br />
Output for 5.5.24
sprintf: 0.11880493164062<br />concat: 0.045753955841064<br />
Output for 5.5.23
sprintf: 0.13749504089355<br />concat: 0.04958701133728<br />
Output for 5.5.22
sprintf: 0.1387460231781<br />concat: 0.045019149780273<br />
Output for 5.5.21
sprintf: 0.15429782867432<br />concat: 0.046780109405518<br />
Output for 5.5.20
sprintf: 0.13250708580017<br />concat: 0.043943881988525<br />
Output for 5.5.19
sprintf: 0.12531900405884<br />concat: 0.044467926025391<br />
Output for 5.5.18
sprintf: 0.13205099105835<br />concat: 0.044116020202637<br />
Output for 5.5.16
sprintf: 0.13044500350952<br />concat: 0.044445991516113<br />
Output for 5.5.15
sprintf: 0.10966897010803<br />concat: 0.04384708404541<br />
Output for 5.5.14
sprintf: 0.14134407043457<br />concat: 0.044075965881348<br />
Output for 5.5.13
sprintf: 0.13786005973816<br />concat: 0.04435396194458<br />
Output for 5.5.12
sprintf: 0.13118386268616<br />concat: 0.044012784957886<br />
Output for 5.5.11
sprintf: 0.14608001708984<br />concat: 0.043700933456421<br />
Output for 5.5.10
sprintf: 0.14361500740051<br />concat: 0.047173023223877<br />
Output for 5.5.9
sprintf: 0.14786100387573<br />concat: 0.044961214065552<br />
Output for 5.5.8
sprintf: 0.13514399528503<br />concat: 0.043998956680298<br />
Output for 5.5.7
sprintf: 0.14699387550354<br />concat: 0.045443058013916<br />
Output for 5.5.6
sprintf: 0.13870096206665<br />concat: 0.04393196105957<br />
Output for 5.5.5
sprintf: 0.14705395698547<br />concat: 0.045981884002686<br />
Output for 5.5.4
sprintf: 0.12938690185547<br />concat: 0.043351888656616<br />
Output for 5.5.3
sprintf: 0.13609480857849<br />concat: 0.04395604133606<br />
Output for 5.5.2
sprintf: 0.19216799736023<br />concat: 0.04449987411499<br />
Output for 5.5.1
sprintf: 0.12611484527588<br />concat: 0.044861078262329<br />
Output for 5.5.0
sprintf: 0.13168406486511<br />concat: 0.043331861495972<br />
Output for 5.4.45
sprintf: 0.1169650554657<br />concat: 0.049835920333862<br />
Output for 5.4.44
sprintf: 0.12759304046631<br />concat: 0.047528028488159<br />
Output for 5.4.43
sprintf: 0.13176894187927<br />concat: 0.046404123306274<br />
Output for 5.4.42
sprintf: 0.13332200050354<br />concat: 0.049384117126465<br />
Output for 5.4.41
sprintf: 0.14120388031006<br />concat: 0.046116828918457<br />
Output for 5.4.40
sprintf: 0.15431499481201<br />concat: 0.050529003143311<br />
Output for 5.4.39
sprintf: 0.14400100708008<br />concat: 0.04375696182251<br />
Output for 5.4.38
sprintf: 0.14228987693787<br />concat: 0.04547381401062<br />
Output for 5.4.37
sprintf: 0.13474798202515<br />concat: 0.043486833572388<br />
Output for 5.4.36
sprintf: 0.14315795898438<br />concat: 0.044116973876953<br />
Output for 5.4.35
sprintf: 0.12877798080444<br />concat: 0.043426036834717<br />
Output for 5.4.34
sprintf: 0.12630987167358<br />concat: 0.045780897140503<br />
Output for 5.4.32
sprintf: 0.1381299495697<br />concat: 0.047369956970215<br />
Output for 5.4.31
sprintf: 0.12985801696777<br />concat: 0.043087005615234<br />
Output for 5.4.30
sprintf: 0.15549206733704<br />concat: 0.042932987213135<br />
Output for 5.4.29
sprintf: 0.12823414802551<br />concat: 0.044613122940063<br />
Output for 5.4.28
sprintf: 0.12939190864563<br />concat: 0.043640851974487<br />
Output for 5.4.27
sprintf: 0.14339709281921<br />concat: 0.043640851974487<br />
Output for 5.4.26
sprintf: 0.15824580192566<br />concat: 0.04410195350647<br />
Output for 5.4.25
sprintf: 0.13443398475647<br />concat: 0.044315099716187<br />
Output for 5.4.24
sprintf: 0.14229607582092<br />concat: 0.058974981307983<br />
Output for 5.4.23
sprintf: 0.14063501358032<br />concat: 0.044130086898804<br />
Output for 5.4.22
sprintf: 0.16126203536987<br />concat: 0.055330038070679<br />
Output for 5.4.21
sprintf: 0.14740896224976<br />concat: 0.044131994247437<br />
Output for 5.4.20
sprintf: 0.15181279182434<br />concat: 0.046007871627808<br />
Output for 5.4.19
sprintf: 0.12728214263916<br />concat: 0.044279098510742<br />
Output for 5.4.18
sprintf: 0.1538610458374<br />concat: 0.043149948120117<br />
Output for 5.4.17
sprintf: 0.1639358997345<br />concat: 0.050441026687622<br />
Output for 5.4.16
sprintf: 0.15060997009277<br />concat: 0.043285131454468<br />
Output for 5.4.15
sprintf: 0.15047597885132<br />concat: 0.043460130691528<br />
Output for 5.4.14
sprintf: 0.13280487060547<br />concat: 0.045841932296753<br />
Output for 5.4.13
sprintf: 0.15194988250732<br />concat: 0.045347929000854<br />
Output for 5.4.12
sprintf: 0.14834904670715<br />concat: 0.045018911361694<br />
Output for 5.4.11
sprintf: 0.15173101425171<br />concat: 0.046395063400269<br />
Output for 5.4.10
sprintf: 0.16438007354736<br />concat: 0.043920040130615<br />
Output for 5.4.9
sprintf: 0.13028907775879<br />concat: 0.043931007385254<br />
Output for 5.4.8
sprintf: 0.1208770275116<br />concat: 0.042841911315918<br />
Output for 5.4.7
sprintf: 0.13379096984863<br />concat: 0.044599056243896<br />
Output for 5.4.6
sprintf: 0.11939597129822<br />concat: 0.044103145599365<br />
Output for 5.4.5
sprintf: 0.12218713760376<br />concat: 0.044318199157715<br />
Output for 5.4.4
sprintf: 0.15462493896484<br />concat: 0.045775890350342<br />
Output for 5.4.3
sprintf: 0.14257788658142<br />concat: 0.048691034317017<br />
Output for 5.4.2
sprintf: 0.13788414001465<br />concat: 0.043493032455444<br />
Output for 5.4.1
sprintf: 0.11953186988831<br />concat: 0.048220872879028<br />
Output for 5.4.0
sprintf: 0.13885998725891<br />concat: 0.053937911987305<br />
Output for 5.3.29
sprintf: 0.17656493186951<br />concat: 0.048550128936768<br />
Output for 5.3.28
sprintf: 0.20559906959534<br />concat: 0.049710035324097<br />
Output for 5.3.27
sprintf: 0.1938591003418<br />concat: 0.049359798431396<br />
Output for 5.3.26
sprintf: 0.22081089019775<br />concat: 0.056336879730225<br />
Output for 5.3.25
sprintf: 0.19350504875183<br />concat: 0.049861192703247<br />
Output for 5.3.24
sprintf: 0.21389889717102<br />concat: 0.048784017562866<br />
Output for 5.3.23
sprintf: 0.20914101600647<br />concat: 0.049939870834351<br />
Output for 5.3.22
sprintf: 0.21139788627625<br />concat: 0.048884868621826<br />
Output for 5.3.21
sprintf: 0.20333790779114<br />concat: 0.050250053405762<br />
Output for 5.3.20
sprintf: 0.20869898796082<br />concat: 0.049623012542725<br />
Output for 5.3.19
sprintf: 0.19299483299255<br />concat: 0.04983115196228<br />
Output for 5.3.18
sprintf: 0.18817806243896<br />concat: 0.049998044967651<br />
Output for 5.3.17
sprintf: 0.17400097846985<br />concat: 0.042640209197998<br />
Output for 5.3.16
sprintf: 0.18003296852112<br />concat: 0.049501895904541<br />
Output for 5.3.15
sprintf: 0.18025994300842<br />concat: 0.049577951431274<br />
Output for 5.3.14
sprintf: 0.18228006362915<br />concat: 0.051309108734131<br />
Output for 5.3.13
sprintf: 0.17889714241028<br />concat: 0.049532175064087<br />
Output for 5.3.12
sprintf: 0.18014192581177<br />concat: 0.049584865570068<br />
Output for 5.3.11
sprintf: 0.18064188957214<br />concat: 0.048732995986938<br />
Output for 5.3.10
sprintf: 0.18421506881714<br />concat: 0.050843000411987<br />
Output for 5.3.9
sprintf: 0.21510696411133<br />concat: 0.050514936447144<br />
Output for 5.3.8
sprintf: 0.1813600063324<br />concat: 0.052817821502686<br />
Output for 5.3.7
sprintf: 0.19720983505249<br />concat: 0.054801940917969<br />
Output for 5.3.6
sprintf: 0.18029594421387<br />concat: 0.050613164901733<br />
Output for 5.3.5
sprintf: 0.21541404724121<br />concat: 0.049785137176514<br />
Output for 5.3.4
sprintf: 0.20162892341614<br />concat: 0.04932689666748<br />
Output for 5.3.3
sprintf: 0.19084119796753<br />concat: 0.049569845199585<br />
Output for 5.3.2
sprintf: 0.17804408073425<br />concat: 0.052011966705322<br />
Output for 5.3.1
sprintf: 0.21410512924194<br />concat: 0.050294160842896<br />
Output for 5.3.0
sprintf: 0.20915913581848<br />concat: 0.051995992660522<br />
Output for 5.2.17
sprintf: 0.22597193717957<br />concat: 0.057487010955811<br />
Output for 5.2.16
sprintf: 0.20752286911011<br />concat: 0.058295965194702<br />
Output for 5.2.15
sprintf: 0.2167341709137<br />concat: 0.058983087539673<br />
Output for 5.2.14
sprintf: 0.19500207901001<br />concat: 0.05701208114624<br />
Output for 5.2.13
sprintf: 0.21369194984436<br />concat: 0.057264089584351<br />
Output for 5.2.12
sprintf: 0.20806694030762<br />concat: 0.058375120162964<br />
Output for 5.2.11
sprintf: 0.19285297393799<br />concat: 0.058550119400024<br />
Output for 5.2.10
sprintf: 0.23035192489624<br />concat: 0.057110786437988<br />
Output for 5.2.9
sprintf: 0.22977781295776<br />concat: 0.060829162597656<br />
Output for 5.2.8
sprintf: 0.20935606956482<br />concat: 0.058173179626465<br />
Output for 5.2.7
sprintf: 0.22611284255981<br />concat: 0.059146881103516<br />
Output for 5.2.6
sprintf: 0.22342705726624<br />concat: 0.058008909225464<br />
Output for 5.2.5
sprintf: 0.2063000202179<br />concat: 0.057568073272705<br />
Output for 5.2.4
sprintf: 0.22646021842957<br />concat: 0.061278104782104<br />
Output for 5.2.3
sprintf: 0.21706795692444<br />concat: 0.057988166809082<br />
Output for 5.2.2
sprintf: 0.22254705429077<br />concat: 0.058641910552979<br />
Output for 5.2.1
sprintf: 0.19461107254028<br />concat: 0.053586959838867<br />
Output for 5.2.0
sprintf: 0.20151686668396<br />concat: 0.062443017959595<br />
Output for 5.1.6
sprintf: 0.22342801094055<br />concat: 0.063215970993042<br />
Output for 5.1.5
sprintf: 0.22099614143372<br />concat: 0.073306798934937<br />
Output for 5.1.4
sprintf: 0.24378895759583<br />concat: 0.064239025115967<br />
Output for 5.1.3
sprintf: 0.22052097320557<br />concat: 0.066849946975708<br />
Output for 5.1.2
sprintf: 0.24953889846802<br />concat: 0.062559127807617<br />
Output for 5.1.1
sprintf: 0.21116805076599<br />concat: 0.062728881835938<br />
Output for 5.1.0
sprintf: 0.21231198310852<br />concat: 0.064154863357544<br />
Output for 5.0.5
sprintf: 0.31894898414612<br />concat: 0.1990818977356<br />
Output for 5.0.4
sprintf: 0.3443660736084<br />concat: 0.19639992713928<br />
Output for 5.0.3
sprintf: 0.31069993972778<br />concat: 0.18880987167358<br />
Output for 5.0.2
sprintf: 0.32114791870117<br />concat: 0.19033789634705<br />
Output for 5.0.1
sprintf: 0.34486198425293<br />concat: 0.18770098686218<br />
Output for 5.0.0
sprintf: 0.30647993087769<br />concat: 0.18810296058655<br />
Output for 4.4.9
sprintf: 0.361645<br />concat: 0.194458<br />
Output for 4.4.8
sprintf: 0.376834<br />concat: 0.193158<br />
Output for 4.4.7
sprintf: 0.353987<br />concat: 0.192601<br />
Output for 4.4.6
sprintf: 0.361665<br />concat: 0.193698<br />
Output for 4.4.5
sprintf: 0.365387<br />concat: 0.196714<br />
Output for 4.4.4
sprintf: 0.353928<br />concat: 0.192406<br />
Output for 4.4.3
sprintf: 0.396056<br />concat: 0.191448<br />
Output for 4.4.2
sprintf: 0.401686<br />concat: 0.19349<br />
Output for 4.4.1
sprintf: 0.39166<br />concat: 0.193475<br />
Output for 4.4.0
sprintf: 0.405837<br />concat: 0.192298<br />
Output for 4.3.11
sprintf: 0.407602<br />concat: 0.191663<br />
Output for 4.3.10
sprintf: 0.383343<br />concat: 0.190767<br />
Output for 4.3.9
sprintf: 0.35621<br />concat: 0.191993<br />
Output for 4.3.8
sprintf: 0.357191<br />concat: 0.194079<br />
Output for 4.3.7
sprintf: 0.357429<br />concat: 0.193043<br />
Output for 4.3.6
sprintf: 0.366694<br />concat: 0.193718<br />
Output for 4.3.5
sprintf: 0.360057<br />concat: 0.196794<br />
Output for 4.3.4
sprintf: 0.327607<br />concat: 0.193313<br />
Output for 4.3.3
sprintf: 0.34377<br />concat: 0.191421<br />
Output for 4.3.2
sprintf: 0.318963<br />concat: 0.190598<br />
Output for 4.3.1
sprintf: 0.309183<br />concat: 0.189128<br />
Output for 4.3.0
sprintf: 0.325251<br />concat: 0.190247<br />