3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<pre><?php $vars['x'] = 10; $vars['y'] = 100; $vars['a'] = '1'; $vars['b'] = 1.1; $start = microtime(true); for ($i = 0; $i<1000000; $i++) { $foo = sprintf('from %s to %s %s %s', $vars['x'], $vars['y'], $vars['a'], $vars['b']); } var_dump(microtime(true) - $start); $start = microtime(true); for ($i = 0; $i<1000000; $i++) { $foo = 'from ' . $vars['x'] . ' to ' . $vars['y'] . ' ' . $vars['a'] . ' '. $vars['b']; } var_dump(microtime(true) - $start); $start = microtime(true); for ($i = 0; $i<1000000; $i++) { $foo = "from {$vars['x']} to {$vars['y']} {$vars['a']} {$vars['b']}"; } var_dump(microtime(true) - $start);
based on opDvE
Output for 7.1.0
<pre>float(0.42486596107483) float(-0.27752804756165) float(1.0104248523712)
Output for 7.0.14
<pre>float(0.56518411636353) float(0.65835690498352) float(0.50279903411865)
Output for 7.0.6
<pre>float(0.38700199127197) float(0.47796416282654) float(0.31890988349915)
Output for 7.0.5
<pre>float(0.39307904243469) float(0.47971200942993) float(0.31408286094666)
Output for 7.0.4
<pre>float(0.38273787498474) float(0.41000819206238) float(0.3212628364563)
Output for 7.0.3
<pre>float(0.38102984428406) float(0.47798299789429) float(0.3312611579895)
Output for 7.0.2
<pre>float(0.36868906021118) float(0.47373294830322) float(0.32120299339294)
Output for 7.0.1
<pre>float(0.3709831237793) float(0.47025895118713) float(0.32397603988647)
Output for 7.0.0
<pre>float(0.3708438873291) float(0.46975803375244) float(0.32431888580322)
Output for hhvm-3.12.0
<pre>float(0.62415099143982) float(0.56638097763062) float(0.58590722084045)
Output for hhvm-3.10.0
<pre>float(0.69021797180176) float(0.64255809783936) float(0.66970109939575)
Output for 5.6.28
<pre>float(0.42580604553223) float(1.018285036087) float(0.60091495513916)
Output for 5.6.21
<pre>float(0.65542197227478) float(0.63878202438354) float(0.57335686683655)
Output for 5.6.20
<pre>float(0.66238594055176) float(0.6396689414978) float(0.58065390586853)
Output for 5.6.19
<pre>float(0.69533586502075) float(0.64085102081299) float(0.59142589569092)
Output for 5.6.18
<pre>float(0.63907217979431) float(0.5828959941864) float(0.51858806610107)
Output for 5.6.17
<pre>float(0.64075303077698) float(0.63061594963074) float(0.57279086112976)
Output for 5.6.16
<pre>float(0.67689204216003) float(0.62775802612305) float(0.56631803512573)
Output for 5.6.15
<pre>float(0.65196013450623) float(0.63767004013062) float(0.57547116279602)
Output for 5.6.14
<pre>float(0.66790199279785) float(0.63547086715698) float(0.57186913490295)
Output for 5.6.13
<pre>float(0.63043904304504) float(0.6383798122406) float(0.57883310317993)
Output for 5.6.12
<pre>float(0.62970304489136) float(0.64429187774658) float(0.60777187347412)
Output for 5.6.11
<pre>float(0.66843891143799) float(0.67006993293762) float(0.59931015968323)
Output for 5.6.10
<pre>float(0.70192408561707) float(0.64699196815491) float(0.56993412971497)
Output for 5.6.9
<pre>float(0.65264797210693) float(0.64693117141724) float(0.582515001297)
Output for 5.6.8
<pre>float(0.69066190719604) float(0.6526780128479) float(0.60388708114624)
Output for 5.5.35
<pre>float(0.69069790840149) float(0.54463601112366) float(0.50133991241455)
Output for 5.5.34
<pre>float(0.695317029953) float(0.60989499092102) float(0.58467602729797)
Output for 5.5.33
<pre>float(0.64744710922241) float(0.54877996444702) float(0.50808215141296)
Output for 5.5.32
<pre>float(0.67296290397644) float(0.61495804786682) float(0.5840060710907)
Output for 5.5.31
<pre>float(0.64580202102661) float(0.62423300743103) float(0.58418607711792)
Output for 5.5.30
<pre>float(0.7075629234314) float(0.66331887245178) float(0.59382796287537)
Output for 5.5.29
<pre>float(0.64620494842529) float(0.629643201828) float(0.57277703285217)
Output for 5.5.28
<pre>float(0.65656805038452) float(0.60552406311035) float(0.57991290092468)
Output for 5.5.27
<pre>float(0.68144488334656) float(0.61381697654724) float(0.57905197143555)
Output for 5.5.26
<pre>float(0.71044588088989) float(0.64501595497131) float(0.58489394187927)
Output for 5.5.25
<pre>float(0.68593192100525) float(0.65856504440308) float(0.60678315162659)
Output for 5.5.24
<pre>float(0.73580193519592) float(0.64622902870178) float(0.59041380882263)
Output for 5.4.45
<pre>float(0.65584802627563) float(0.54388308525085) float(0.51656484603882)
Output for 5.4.44
<pre>float(0.6610279083252) float(0.54853391647339) float(0.51869606971741)
Output for 5.4.43
<pre>float(0.69588708877563) float(0.551029920578) float(0.51849293708801)
Output for 5.4.42
<pre>float(0.70140099525452) float(0.55646681785583) float(0.51776599884033)
Output for 5.4.41
<pre>float(0.67827606201172) float(0.55475306510925) float(0.53397917747498)
Output for 5.4.40
<pre>float(0.70776414871216) float(0.53628301620483) float(0.5108048915863)
Output for 5.4.39
<pre>float(0.64956498146057) float(0.52890205383301) float(0.51399993896484)
Output for 5.4.38
<pre>float(0.65870904922485) float(0.54098701477051) float(0.51449608802795)
Output for 5.4.37
<pre>float(0.78892612457275) float(0.69474792480469) float(0.60801601409912)
Output for 5.4.36
<pre>float(0.65367794036865) float(0.52993106842041) float(0.51578307151794)
Output for 5.4.35
<pre>float(0.68117594718933) float(0.53803300857544) float(0.51230216026306)
Output for 5.4.34
<pre>float(0.83391499519348) float(0.66970705986023) float(0.68436002731323)
Output for 5.4.32
<pre>float(0.66821885108948) float(0.52972912788391) float(0.50817108154297)
Output for 5.4.31
<pre>float(0.78063821792603) float(0.72455310821533)
Process exited with code 137.
Output for 5.4.30
<pre>float(0.77630591392517) float(0.72959113121033)
Process exited with code 137.
Output for 5.4.29
<pre>float(0.83856606483459) float(0.76900792121887)
Process exited with code 137.
Output for 5.4.28
<pre>float(0.93979501724243) float(0.73931217193604)
Process exited with code 137.
Output for 5.4.27
<pre>float(0.83248901367188) float(0.7183039188385)
Process exited with code 137.
Output for 5.4.26
<pre>float(0.79593014717102) float(0.75892400741577)
Process exited with code 137.
Output for 5.4.25
<pre>float(0.8087170124054) float(0.72058486938477)
Process exited with code 137.
Output for 5.4.24
<pre>float(0.83753395080566) float(0.75615382194519)
Process exited with code 137.
Output for 5.4.23
<pre>float(0.79721093177795) float(0.74890899658203)
Process exited with code 137.
Output for 5.4.22
<pre>float(0.7960798740387) float(0.72741198539734)
Process exited with code 137.
Output for 5.4.21
<pre>float(0.84345817565918) float(0.75706005096436)
Process exited with code 137.
Output for 5.4.20
<pre>float(0.87220001220703) float(0.76465606689453)
Process exited with code 137.
Output for 5.4.19
<pre>float(0.8621780872345) float(0.88422298431396)
Process exited with code 137.
Output for 5.4.18
<pre>float(1.106290102005) float(0.81332492828369)
Process exited with code 137.
Output for 5.4.17
<pre>float(1.2131500244141) float(0.7534441947937)
Process exited with code 137.
Output for 5.4.16
<pre>float(0.91760778427124) float(0.86648511886597)
Process exited with code 137.
Output for 5.4.15
<pre>float(0.87899684906006) float(1.1327168941498)
Process exited with code 137.
Output for 5.4.14
<pre>float(0.9585280418396) float(1.428633928299)
Process exited with code 137.
Output for 5.4.13
<pre>float(1.3958239555359)
Process exited with code 137.
Output for 5.4.12
<pre>float(1.5464460849762) float(0.8449981212616)
Process exited with code 137.
Output for 5.4.11
<pre>float(0.70105195045471) float(0.52985811233521) float(0.50962090492249)
Output for 5.4.10
<pre>float(0.68057203292847) float(0.53627109527588) float(0.51696395874023)
Output for 5.4.9
<pre>float(0.65986013412476) float(0.52755117416382) float(0.51665306091309)
Output for 5.4.8
<pre>float(0.68940305709839) float(0.5375919342041) float(0.51910996437073)
Output for 5.4.7
<pre>float(0.78404808044434) float(0.53077602386475) float(0.51519083976746)
Output for 5.4.6
<pre>float(0.7005889415741) float(0.53739190101624) float(0.51805591583252)
Output for 5.4.5
<pre>float(0.70610189437866) float(0.54406404495239) float(0.51618909835815)
Output for 5.4.4
<pre>float(0.76835107803345) float(0.60412406921387) float(0.53630805015564)
Output for 5.4.3
<pre>float(0.68340992927551) float(0.54094386100769) float(0.52382779121399)
Output for 5.4.2
<pre>float(0.69504284858704) float(0.54955792427063) float(0.51985502243042)
Output for 5.4.1
<pre>float(0.71462512016296) float(0.58796977996826) float(0.52155089378357)
Output for 5.4.0
<pre>float(0.6643397808075) float(0.54352712631226) float(0.52727794647217)
Output for 5.3.29
<pre>float(0.73598599433899) float(0.55073881149292) float(0.54269886016846)
Output for 5.3.28
<pre>float(0.73538708686829) float(0.5706090927124) float(0.54791283607483)
Output for 5.3.27
<pre>float(0.72009706497192) float(0.56641912460327) float(0.55237793922424)
Output for 5.3.26
<pre>float(0.74268412590027) float(0.59087800979614) float(0.55106401443481)
Output for 5.3.25
<pre>float(1.0370478630066) float(0.80617213249207)
Process exited with code 137.
Output for 5.3.24
<pre>float(0.76341390609741) float(0.57442903518677) float(0.5447690486908)
Output for 5.3.23
<pre>float(0.78417801856995) float(0.55549097061157) float(0.57892513275146)
Output for 5.3.22
<pre>float(0.75079989433289) float(0.5684609413147) float(0.5605149269104)
Output for 5.3.21
<pre>float(0.98891401290894) float(0.81838202476501)
Process exited with code 137.
Output for 5.3.20
<pre>float(0.77046298980713) float(0.58179616928101) float(0.55243706703186)
Output for 5.3.19
<pre>float(0.73868489265442) float(0.59784197807312) float(0.54505586624146)
Output for 5.3.18
<pre>float(0.92463207244873) float(0.56990694999695) float(0.56531810760498)
Output for 5.3.17
<pre>float(0.79479312896729) float(0.56524705886841) float(0.55312299728394)
Output for 5.3.16
<pre>float(0.77108693122864) float(0.58560013771057) float(0.55770611763)
Output for 5.3.15
<pre>float(1.0916290283203) float(0.84178686141968)
Process exited with code 137.
Output for 5.3.14
<pre>float(0.75322389602661) float(0.58944988250732) float(0.56500887870789)
Output for 5.3.13
<pre>float(0.78089690208435) float(0.5741400718689) float(0.55593204498291)
Output for 5.3.12
<pre>float(0.76419806480408) float(0.57349395751953) float(0.55075907707214)
Output for 5.3.11
<pre>float(0.76424312591553) float(0.56942701339722) float(0.55027413368225)
Output for 5.3.10
<pre>float(0.75710105895996) float(0.56099796295166) float(0.54718518257141)
Output for 5.3.9
<pre>float(1.1087620258331) float(0.74611806869507) float(0.55614900588989)
Output for 5.3.8
<pre>float(0.78163719177246) float(0.5725040435791) float(0.54104280471802)
Output for 5.3.7
<pre>float(0.76516914367676) float(0.56225609779358) float(0.54447793960571)