3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string1 = 'aaaaaaaaaaaaaaaaaaaa'; $string2 = 'bbbbbbbbbbbbbbbbbbbb'; $string3 = 'cccccccccccccccccccc'; $string4 = 'dddddddddddddddddddd'; $string5 = 'eeeeeeeeeeeeeeeeeeee'; $time1 = microtime(true); for ($k = 0; $k<1000000; $k++) { $concatTest1 = $string1 . $string2 . $string3 . $string4 . $string5; } $time2 = microtime(true); $testDuration1 = $time2 - $time1; echo "Test 1 took $testDuration1 Seconds"; $time3 = microtime(true); for ($m = 0; $m<1000000; $m++) { $concatTest2 = "{$string1}{$string2}{$string3}{$string4}{$string5}"; } $time4 = microtime(true); $testDuration2 = $time4 - $time3; echo "Test 2 took $testDuration2 Seconds"; $time5 = microtime(true); for ($p = 0; $p<1000000; $p++) { $concatTest3 = implode('', array($string1, $string2, $string3, $string4, $string5)); } $time6 = microtime(true); $testDuration3 = $time6 - $time5; echo "Test 3 took $testDuration3 Seconds";
Output for 5.4.17
Test 1 took 0.20565509796143 SecondsTest 2 took 0.24726700782776 SecondsTest 3 took 0.682776927948 Seconds
Output for 5.4.16
Test 1 took 0.22237610816956 SecondsTest 2 took 0.31802010536194 SecondsTest 3 took 1.1399118900299 Seconds
Output for 5.4.15
Test 1 took 0.20157694816589 SecondsTest 2 took 0.27167701721191 SecondsTest 3 took 0.64218497276306 Seconds
Output for 5.4.14
Test 1 took 0.2049400806427 SecondsTest 2 took 0.20652985572815 SecondsTest 3 took 0.60310697555542 Seconds
Output for 5.4.13
Test 1 took 0.24647188186646 SecondsTest 2 took 0.27636194229126 SecondsTest 3 took 0.73925399780273 Seconds
Output for 5.4.12
Test 1 took 0.20415210723877 SecondsTest 2 took 0.22231698036194 SecondsTest 3 took 0.74685883522034 Seconds
Output for 5.4.11
Test 1 took 0.21067094802856 SecondsTest 2 took 0.23455786705017 SecondsTest 3 took 0.65293002128601 Seconds
Output for 5.4.10
Test 1 took 0.20568799972534 SecondsTest 2 took 0.22139692306519 SecondsTest 3 took 0.6715099811554 Seconds
Output for 5.4.9
Test 1 took 0.23010492324829 SecondsTest 2 took 0.24479603767395 SecondsTest 3 took 0.8288369178772 Seconds
Output for 5.4.8
Test 1 took 0.23074984550476 SecondsTest 2 took 0.20368790626526 SecondsTest 3 took 0.61293292045593 Seconds
Output for 5.4.7
Test 1 took 0.2283570766449 SecondsTest 2 took 0.23081994056702 SecondsTest 3 took 0.65935587882996 Seconds
Output for 5.4.6
Test 1 took 0.20940899848938 SecondsTest 2 took 0.21475601196289 SecondsTest 3 took 0.71005702018738 Seconds
Output for 5.4.5
Test 1 took 0.25808620452881 SecondsTest 2 took 0.24797296524048 SecondsTest 3 took 0.69985294342041 Seconds
Output for 5.4.4
Test 1 took 0.20171904563904 SecondsTest 2 took 0.20175194740295 SecondsTest 3 took 0.69939589500427 Seconds
Output for 5.4.3
Test 1 took 0.19779086112976 SecondsTest 2 took 0.29674291610718 SecondsTest 3 took 0.72308897972107 Seconds
Output for 5.4.2
Test 1 took 0.2061231136322 SecondsTest 2 took 0.23746800422668 SecondsTest 3 took 0.63977813720703 Seconds
Output for 5.4.1
Test 1 took 0.2025420665741 SecondsTest 2 took 0.23487091064453 SecondsTest 3 took 0.75721597671509 Seconds
Output for 5.4.0
Test 1 took 0.20925498008728 SecondsTest 2 took 0.23434114456177 SecondsTest 3 took 0.67245197296143 Seconds
Output for 5.3.27
Test 1 took 0.34212899208069 SecondsTest 2 took 0.31076598167419 SecondsTest 3 took 0.92293691635132 Seconds
Output for 5.3.26
Test 1 took 0.29297614097595 SecondsTest 2 took 0.37881588935852 SecondsTest 3 took 0.75842809677124 Seconds
Output for 5.3.25
Test 1 took 0.23015189170837 SecondsTest 2 took 0.23320817947388 SecondsTest 3 took 0.66193985939026 Seconds
Output for 5.3.24
Test 1 took 0.2540020942688 SecondsTest 2 took 0.25717306137085 SecondsTest 3 took 0.74076008796692 Seconds
Output for 5.3.23
Test 1 took 0.25691604614258 SecondsTest 2 took 0.24795699119568 SecondsTest 3 took 0.78276085853577 Seconds
Output for 5.3.22
Test 1 took 0.26613903045654 SecondsTest 2 took 0.24958276748657 SecondsTest 3 took 0.67149186134338 Seconds
Output for 5.3.21
Test 1 took 0.21854090690613 SecondsTest 2 took 0.31401586532593 SecondsTest 3 took 0.81082797050476 Seconds
Output for 5.3.20
Test 1 took 0.23063898086548 SecondsTest 2 took 0.27087306976318 SecondsTest 3 took 0.80046510696411 Seconds
Output for 5.3.19
Test 1 took 0.22641921043396 SecondsTest 2 took 0.22522497177124 SecondsTest 3 took 0.68341398239136 Seconds
Output for 5.3.18
Test 1 took 0.26773691177368 SecondsTest 2 took 0.23284506797791 SecondsTest 3 took 0.66120004653931 Seconds
Output for 5.3.17
Test 1 took 0.25477290153503 SecondsTest 2 took 0.23553800582886 SecondsTest 3 took 0.70012903213501 Seconds
Output for 5.3.16
Test 1 took 0.23885989189148 SecondsTest 2 took 0.23328399658203 SecondsTest 3 took 0.78509092330933 Seconds
Output for 5.3.15
Test 1 took 0.2728579044342 SecondsTest 2 took 0.26955389976501 SecondsTest 3 took 0.90302085876465 Seconds
Output for 5.3.14
Test 1 took 0.23044180870056 SecondsTest 2 took 0.24552416801453 SecondsTest 3 took 1.0958271026611 Seconds
Output for 5.3.13
Test 1 took 0.24620294570923 SecondsTest 2 took 0.23640894889832 SecondsTest 3 took 0.75305986404419 Seconds
Output for 5.3.12
Test 1 took 0.26148009300232 SecondsTest 2 took 0.25308418273926 SecondsTest 3 took 0.67020702362061 Seconds
Output for 5.3.11
Test 1 took 0.24046587944031 SecondsTest 2 took 0.23462510108948 SecondsTest 3 took 0.81422400474548 Seconds
Output for 5.3.10
Test 1 took 0.25630307197571 SecondsTest 2 took 0.24704098701477 SecondsTest 3 took 0.73270201683044 Seconds
Output for 5.3.9
Test 1 took 0.25367617607117 SecondsTest 2 took 0.31616497039795 SecondsTest 3 took 0.88796997070312 Seconds
Output for 5.3.8
Test 1 took 0.23789620399475 SecondsTest 2 took 0.2927029132843 SecondsTest 3 took 0.82719302177429 Seconds
Output for 5.3.7
Test 1 took 0.25110387802124 SecondsTest 2 took 0.2461678981781 SecondsTest 3 took 0.76073288917542 Seconds
Output for 5.3.6
Test 1 took 0.22233200073242 SecondsTest 2 took 0.26083397865295 SecondsTest 3 took 0.74809789657593 Seconds
Output for 5.3.5
Test 1 took 0.26614689826965 SecondsTest 2 took 0.37414002418518 SecondsTest 3 took 0.83121800422668 Seconds
Output for 5.3.4
Test 1 took 0.32089710235596 SecondsTest 2 took 0.24606013298035 SecondsTest 3 took 0.81593298912048 Seconds
Output for 5.2.17
Test 1 took 0.36414289474487 SecondsTest 2 took 0.33103489875793 SecondsTest 3 took 0.80406308174133 Seconds
Output for 5.2.16
Test 1 took 0.30958294868469 SecondsTest 2 took 0.31887602806091 SecondsTest 3 took 0.82742619514465 Seconds
Output for 5.2.15
Test 1 took 0.29502606391907 SecondsTest 2 took 0.35130882263184 SecondsTest 3 took 0.87115502357483 Seconds