3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $time = [0, 0, 0, 0];for($i = 0; $i < 50; ++$i){ $k = 0; $t = microtime(true); $x = 0; for($j = 0; $j < 100000; ++$j) ++$x; $time[$k++] += microtime(true) - $t; $t = microtime(true); $x = 0; for($j = 0; $j < 100000; ++$j) $x++; $time[$k++] += microtime(true) - $t; $t = microtime(true); $x = 0; for($j = 0; $j < 100000; ++$j) $x += 1; $time[$k++] += microtime(true) - $t; $t = microtime(true); $x = 0; for($j = 0; $j < 100000; ++$j) $x = $x + 1; $time[$k++] += microtime(true) - $t; } echo '++$x: ', $time[0] * 1000, 'ms<br />'; echo '$x++: ', $time[1] * 1000, 'ms<br />'; echo '$x += 1: ', $time[2] * 1000, 'ms<br />'; echo '$x = $x + 1: ', $time[3] * 1000, 'ms<br />';
based on MQRZK
Output for 7.1.0
++$x: 48.750162124634ms<br />$x++: 62.749624252319ms<br />$x += 1: 72.175741195679ms<br />$x = $x + 1: 66.230773925781ms<br />
Output for 7.0.14
++$x: 43.352127075195ms<br />$x++: 58.16125869751ms<br />$x += 1: 72.639465332031ms<br />$x = $x + 1: 57.80291557312ms<br />
Output for 7.0.6
++$x: 45.089721679688ms<br />$x++: 53.448677062988ms<br />$x += 1: 66.070318222046ms<br />$x = $x + 1: 55.705547332764ms<br />
Output for 7.0.5
++$x: 44.17085647583ms<br />$x++: 53.627490997314ms<br />$x += 1: 63.129901885986ms<br />$x = $x + 1: 52.457809448242ms<br />
Output for 7.0.4
++$x: 37.450075149536ms<br />$x++: 55.771112442017ms<br />$x += 1: 69.008827209473ms<br />$x = $x + 1: 55.684328079224ms<br />
Output for 7.0.3
++$x: 35.304307937622ms<br />$x++: 52.866697311401ms<br />$x += 1: 65.450668334961ms<br />$x = $x + 1: 51.232099533081ms<br />
Output for 7.0.2
++$x: 41.895151138306ms<br />$x++: 59.345722198486ms<br />$x += 1: 75.474977493286ms<br />$x = $x + 1: 61.119794845581ms<br />
Output for 7.0.1
++$x: 33.636808395386ms<br />$x++: 48.901081085205ms<br />$x += 1: 62.164783477783ms<br />$x = $x + 1: 50.637245178223ms<br />
Output for 7.0.0
++$x: 38.901090621948ms<br />$x++: 50.328493118286ms<br />$x += 1: 63.31467628479ms<br />$x = $x + 1: 56.208372116089ms<br />
Output for 5.6.28
++$x: 194.86784934998ms<br />$x++: 144.20628547668ms<br />$x += 1: 213.84572982788ms<br />$x = $x + 1: 144.27208900452ms<br />
Output for 5.6.21
++$x: 127.84719467163ms<br />$x++: 148.73719215393ms<br />$x += 1: 160.65788269043ms<br />$x = $x + 1: 152.04381942749ms<br />
Output for 5.6.20
++$x: 113.99245262146ms<br />$x++: 135.31708717346ms<br />$x += 1: 139.85395431519ms<br />$x = $x + 1: 137.96973228455ms<br />
Output for 5.6.19
++$x: 110.19206047058ms<br />$x++: 130.37467002869ms<br />$x += 1: 135.66732406616ms<br />$x = $x + 1: 129.41408157349ms<br />
Output for 5.6.18
++$x: 107.48505592346ms<br />$x++: 128.72099876404ms<br />$x += 1: 134.95826721191ms<br />$x = $x + 1: 128.13448905945ms<br />
Output for 5.6.17
++$x: 107.43880271912ms<br />$x++: 129.0922164917ms<br />$x += 1: 137.04943656921ms<br />$x = $x + 1: 128.04007530212ms<br />
Output for 5.6.16
++$x: 102.81419754028ms<br />$x++: 123.45838546753ms<br />$x += 1: 129.06193733215ms<br />$x = $x + 1: 123.18444252014ms<br />
Output for 5.6.15
++$x: 111.92011833191ms<br />$x++: 134.40895080566ms<br />$x += 1: 139.64891433716ms<br />$x = $x + 1: 132.81321525574ms<br />
Output for 5.6.14
++$x: 106.9393157959ms<br />$x++: 128.8914680481ms<br />$x += 1: 133.67700576782ms<br />$x = $x + 1: 127.48789787292ms<br />
Output for 5.6.13
++$x: 104.44736480713ms<br />$x++: 125.74982643127ms<br />$x += 1: 130.92446327209ms<br />$x = $x + 1: 125.0205039978ms<br />
Output for 5.6.12
++$x: 108.34527015686ms<br />$x++: 130.08522987366ms<br />$x += 1: 135.39338111877ms<br />$x = $x + 1: 128.74412536621ms<br />
Output for 5.6.11
++$x: 113.58547210693ms<br />$x++: 135.7045173645ms<br />$x += 1: 141.23773574829ms<br />$x = $x + 1: 134.34600830078ms<br />
Output for 5.6.10
++$x: 104.17294502258ms<br />$x++: 125.16188621521ms<br />$x += 1: 130.68556785583ms<br />$x = $x + 1: 124.84359741211ms<br />
Output for 5.6.9
++$x: 108.55889320374ms<br />$x++: 132.22026824951ms<br />$x += 1: 140.53988456726ms<br />$x = $x + 1: 130.80906867981ms<br />
Output for 5.6.8
++$x: 110.75377464294ms<br />$x++: 132.36165046692ms<br />$x += 1: 138.94176483154ms<br />$x = $x + 1: 131.81352615356ms<br />
Output for 5.5.35
++$x: 112.309217453ms<br />$x++: 122.98440933228ms<br />$x += 1: 130.46002388ms<br />$x = $x + 1: 126.2378692627ms<br />
Output for 5.5.34
++$x: 108.61659049988ms<br />$x++: 129.8496723175ms<br />$x += 1: 138.26179504395ms<br />$x = $x + 1: 129.28533554077ms<br />
Output for 5.5.33
++$x: 108.37316513062ms<br />$x++: 130.92470169067ms<br />$x += 1: 144.22988891602ms<br />$x = $x + 1: 130.1109790802ms<br />
Output for 5.5.32
++$x: 109.10630226135ms<br />$x++: 131.6921710968ms<br />$x += 1: 136.06739044189ms<br />$x = $x + 1: 129.75740432739ms<br />
Output for 5.5.31
++$x: 115.10729789734ms<br />$x++: 135.02144813538ms<br />$x += 1: 147.32313156128ms<br />$x = $x + 1: 139.73093032837ms<br />
Output for 5.5.30
++$x: 109.35926437378ms<br />$x++: 131.07419013977ms<br />$x += 1: 144.62924003601ms<br />$x = $x + 1: 131.58512115479ms<br />
Output for 5.5.29
++$x: 110.39137840271ms<br />$x++: 132.96484947205ms<br />$x += 1: 137.86005973816ms<br />$x = $x + 1: 131.34360313416ms<br />
Output for 5.5.28
++$x: 109.41600799561ms<br />$x++: 132.6630115509ms<br />$x += 1: 136.00969314575ms<br />$x = $x + 1: 129.90689277649ms<br />
Output for 5.5.27
++$x: 109.16233062744ms<br />$x++: 131.08849525452ms<br />$x += 1: 135.91051101685ms<br />$x = $x + 1: 129.23860549927ms<br />
Output for 5.5.26
++$x: 111.0577583313ms<br />$x++: 134.01865959167ms<br />$x += 1: 139.86253738403ms<br />$x = $x + 1: 131.1309337616ms<br />
Output for 5.5.25
++$x: 114.63618278503ms<br />$x++: 137.76755332947ms<br />$x += 1: 143.52750778198ms<br />$x = $x + 1: 136.57474517822ms<br />
Output for 5.5.24
++$x: 86.989164352417ms<br />$x++: 103.8236618042ms<br />$x += 1: 110.88299751282ms<br />$x = $x + 1: 104.02750968933ms<br />
Output for 5.4.45
++$x: 280.12728691101ms<br />$x++: 193.59970092773ms<br />$x += 1: 207.19170570374ms<br />$x = $x + 1: 198.0037689209ms<br />
Output for 5.4.44
++$x: 274.00135993958ms<br />$x++: 187.35480308533ms<br />$x += 1: 313.40837478638ms<br />$x = $x + 1: 195.79410552979ms<br />
Output for 5.4.43
++$x: 278.47528457642ms<br />$x++: 190.39559364319ms<br />$x += 1: 195.4038143158ms<br />$x = $x + 1: 191.80679321289ms<br />
Output for 5.4.42
++$x: 272.10354804993ms<br />$x++: 215.26575088501ms<br />$x += 1: 304.76307868958ms<br />$x = $x + 1: 188.53831291199ms<br />
Output for 5.4.41
++$x: 268.83578300476ms<br />$x++: 181.84351921082ms<br />$x += 1: 187.34288215637ms<br />$x = $x + 1: 189.91684913635ms<br />
Output for 5.4.40
++$x: 317.30079650879ms<br />$x++: 225.65698623657ms<br />$x += 1: 232.7139377594ms<br />$x = $x + 1: 221.08769416809ms<br />
Output for 5.4.39
++$x: 311.81526184082ms<br />$x++: 219.7060585022ms<br />$x += 1: 213.01317214966ms<br />$x = $x + 1: 220.52073478699ms<br />
Output for 5.4.38
++$x: 274.96099472046ms<br />$x++: 191.79749488831ms<br />$x += 1: 189.861536026ms<br />$x = $x + 1: 188.37285041809ms<br />
Output for 5.4.37
++$x: 205.22904396057ms<br />$x++: 141.72029495239ms<br />$x += 1: 144.8962688446ms<br />$x = $x + 1: 140.98000526428ms<br />
Output for 5.4.36
++$x: 204.11777496338ms<br />$x++: 136.66129112244ms<br />$x += 1: 138.91696929932ms<br />$x = $x + 1: 140.16771316528ms<br />
Output for 5.4.35
++$x: 250.12135505676ms<br />$x++: 190.44756889343ms<br />$x += 1: 178.61676216125ms<br />$x = $x + 1: 202.58212089539ms<br />
Output for 5.4.34
++$x: 222.4588394165ms<br />$x++: 151.69835090637ms<br />$x += 1: 178.94887924194ms<br />$x = $x + 1: 173.45857620239ms<br />
Output for 5.4.32
++$x: 202.32605934143ms<br />$x++: 138.27729225159ms<br />$x += 1: 142.16876029968ms<br />$x = $x + 1: 140.94281196594ms<br />
Output for 5.4.31
++$x: 205.8641910553ms<br />$x++: 139.56880569458ms<br />$x += 1: 143.43595504761ms<br />$x = $x + 1: 142.20952987671ms<br />
Output for 5.4.30
++$x: 207.41152763367ms<br />$x++: 141.38889312744ms<br />$x += 1: 145.87306976318ms<br />$x = $x + 1: 144.3567276001ms<br />
Output for 5.4.29
++$x: 205.5459022522ms<br />$x++: 140.47765731812ms<br />$x += 1: 139.74142074585ms<br />$x = $x + 1: 139.98198509216ms<br />
Output for 5.4.28
++$x: 209.03468132019ms<br />$x++: 139.82462882996ms<br />$x += 1: 146.89779281616ms<br />$x = $x + 1: 140.0933265686ms<br />
Output for 5.4.27
++$x: 209.3198299408ms<br />$x++: 141.69120788574ms<br />$x += 1: 149.40166473389ms<br />$x = $x + 1: 145.00498771667ms<br />
Output for 5.4.26
++$x: 211.18092536926ms<br />$x++: 138.4060382843ms<br />$x += 1: 144.24824714661ms<br />$x = $x + 1: 143.05305480957ms<br />
Output for 5.4.25
++$x: 206.51602745056ms<br />$x++: 142.41647720337ms<br />$x += 1: 143.98598670959ms<br />$x = $x + 1: 139.98532295227ms<br />
Output for 5.4.24
++$x: 204.31590080261ms<br />$x++: 138.20219039917ms<br />$x += 1: 141.57819747925ms<br />$x = $x + 1: 138.57555389404ms<br />
Output for 5.4.23
++$x: 207.3335647583ms<br />$x++: 137.4945640564ms<br />$x += 1: 230.63993453979ms<br />$x = $x + 1: 143.67961883545ms<br />
Output for 5.4.22
++$x: 209.0961933136ms<br />$x++: 137.4204158783ms<br />$x += 1: 144.04249191284ms<br />$x = $x + 1: 141.85667037964ms<br />
Output for 5.4.21
++$x: 204.67042922974ms<br />$x++: 137.52841949463ms<br />$x += 1: 141.23058319092ms<br />$x = $x + 1: 138.53216171265ms<br />
Output for 5.4.20
++$x: 206.70652389526ms<br />$x++: 137.25018501282ms<br />$x += 1: 139.94956016541ms<br />$x = $x + 1: 139.79840278625ms<br />
Output for 5.4.19
++$x: 206.12454414368ms<br />$x++: 138.74840736389ms<br />$x += 1: 140.53702354431ms<br />$x = $x + 1: 139.47463035583ms<br />
Output for 5.4.18
++$x: 203.98330688477ms<br />$x++: 137.78233528137ms<br />$x += 1: 140.72012901306ms<br />$x = $x + 1: 137.3279094696ms<br />
Output for 5.4.17
++$x: 200.27089118958ms<br />$x++: 135.77437400818ms<br />$x += 1: 138.26370239258ms<br />$x = $x + 1: 133.93688201904ms<br />
Output for 5.4.16
++$x: 203.1888961792ms<br />$x++: 134.96279716492ms<br />$x += 1: 138.41843605042ms<br />$x = $x + 1: 135.52236557007ms<br />
Output for 5.4.15
++$x: 203.30786705017ms<br />$x++: 135.38837432861ms<br />$x += 1: 137.54057884216ms<br />$x = $x + 1: 135.58340072632ms<br />
Output for 5.4.14
++$x: 210.17813682556ms<br />$x++: 137.91632652283ms<br />$x += 1: 140.76733589172ms<br />$x = $x + 1: 141.63875579834ms<br />
Output for 5.4.13
++$x: 203.82785797119ms<br />$x++: 137.16864585876ms<br />$x += 1: 140.61689376831ms<br />$x = $x + 1: 137.09211349487ms<br />
Output for 5.4.12
++$x: 207.88741111755ms<br />$x++: 134.99546051025ms<br />$x += 1: 135.90526580811ms<br />$x = $x + 1: 145.99561691284ms<br />
Output for 5.4.11
++$x: 207.37218856812ms<br />$x++: 135.19406318665ms<br />$x += 1: 136.22379302979ms<br />$x = $x + 1: 148.95153045654ms<br />
Output for 5.4.10
++$x: 209.91706848145ms<br />$x++: 137.11953163147ms<br />$x += 1: 138.74411582947ms<br />$x = $x + 1: 149.46579933167ms<br />
Output for 5.4.9
++$x: 201.68375968933ms<br />$x++: 137.94255256653ms<br />$x += 1: 138.34619522095ms<br />$x = $x + 1: 145.48802375793ms<br />
Output for 5.4.8
++$x: 207.62133598328ms<br />$x++: 140.31791687012ms<br />$x += 1: 141.73913002014ms<br />$x = $x + 1: 144.61994171143ms<br />
Output for 5.4.7
++$x: 205.53755760193ms<br />$x++: 139.000415802ms<br />$x += 1: 142.01402664185ms<br />$x = $x + 1: 146.93975448608ms<br />
Output for 5.4.6
++$x: 202.13675498962ms<br />$x++: 227.81872749329ms<br />$x += 1: 139.77265357971ms<br />$x = $x + 1: 232.08618164062ms<br />
Output for 5.4.5
++$x: 206.79545402527ms<br />$x++: 215.00444412231ms<br />$x += 1: 140.88869094849ms<br />$x = $x + 1: 147.93491363525ms<br />
Output for 5.4.4
++$x: 207.74340629578ms<br />$x++: 137.85767555237ms<br />$x += 1: 138.81611824036ms<br />$x = $x + 1: 146.9509601593ms<br />
Output for 5.4.3
++$x: 212.20397949219ms<br />$x++: 142.93670654297ms<br />$x += 1: 145.22266387939ms<br />$x = $x + 1: 223.41728210449ms<br />
Output for 5.4.2
++$x: 209.88488197327ms<br />$x++: 140.8429145813ms<br />$x += 1: 144.27280426025ms<br />$x = $x + 1: 178.13563346863ms<br />
Output for 5.4.1
++$x: 211.77768707275ms<br />$x++: 143.67032051086ms<br />$x += 1: 140.70153236389ms<br />$x = $x + 1: 221.96483612061ms<br />
Output for 5.4.0
++$x: 206.48193359375ms<br />$x++: 135.72072982788ms<br />$x += 1: 139.23072814941ms<br />$x = $x + 1: 137.68815994263ms<br />
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/iaMDo on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/iaMDo on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/iaMDo on line 3
Process exited with code 255.