3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function timeFunc($function, $runs) { $start = microtime(true); for ($i = 0; $i < $runs; $i++) { call_user_func($function); } return (microtime(true) - $start); } function Method1() { $foo = 'some words'; for ($i = 0; $i < 10000; $i++) { $t = "these are $foo"; } } function Method2() { $foo = 'some words'; for ($i = 0; $i < 10000; $i++) { $t = "these are {$foo}"; } } function Method3() { $foo = 'some words'; for ($i = 0; $i < 10000; $i++) { $t = "these are " . $foo; } } $a = timeFunc('Method1', 10); $b = timeFunc('Method2', 10); $c = timeFunc('Method3', 10); echo ($a + $b) / (2 * $a) . "\n"; echo ($a + $c) / (2 * $a) . "\n";
Output for 7.1.0
0.98888924110822 0.88876561212198
Output for 7.0.14
0.94802307150405 0.9167180345192
Output for 7.0.10
0.996129745669 0.91639021992874
Output for 7.0.9
0.94218932804314 0.91955338521797
Output for 7.0.8
0.92814828969998 0.91012166380024
Output for 7.0.7
0.94224884601421 0.91712048130284
Output for 7.0.6
0.96530403679101 0.93208993357179
Output for 7.0.5
0.99702982423908 0.92087696735869
Output for 7.0.4
0.95662978244561 0.91365810202551
Output for 7.0.3
0.94600543478261 0.93288043478261
Output for 7.0.2
0.94764883816857 0.9378523305376
Output for 7.0.1
0.89681643239625 0.86811830655957
Output for 7.0.0
0.95823056545172 0.93066593587284
Output for 5.6.28
0.96343552354181 0.89898834621691
Output for 5.6.25
0.99350453172205 0.90902567975831
Output for 5.6.24
0.89883386509684 0.81758639284591
Output for 5.6.23
1.0027381440227 0.89095853667623
Output for 5.6.22
1.1882725940848 0.87190962366084
Output for 5.6.21
0.98306893567926 0.88530429766369
Output for 5.6.20
0.96777423759672 0.86015020482476
Output for 5.6.19
0.97963577971607 0.92430933177621
Output for 5.6.18
0.97129652152761 0.97825954755534
Output for 5.6.17
1.0408198316826 0.87575141695769
Output for 5.6.16
0.96799590774637 0.86319862998465
Output for 5.6.15
1.0271691879673 0.89133773836434
Output for 5.6.14
0.97004419917733 0.87430060550318
Output for 5.6.13
0.98636210099645 0.87383887856781
Output for 5.6.12
0.96930284515776 0.86015867225971
Output for 5.6.11
0.9776667187256 0.88136810869905
Output for 5.6.10
0.96744415316708 0.85607537361923
Output for 5.6.9
0.97549072622073 0.86469204563889
Output for 5.6.8
0.83149835732165 0.75373513767209
Output for 5.6.7
0.95810363836825 0.86099434950386
Output for 5.6.6
0.98143255981508 0.86654558554231
Output for 5.6.5
0.9727284964329 0.86270022883295
Output for 5.6.4
0.98251696665683 0.87393036293892
Output for 5.6.3
0.91346333489024 0.81452592246614
Output for 5.6.2
0.963471152402 0.84228763919583
Output for 5.6.1
0.96909826615729 0.85659063679725
Output for 5.6.0
0.97087225906385 0.85535359891573
Output for 5.5.38
0.95200957441212 0.85475301173129
Output for 5.5.37
0.97764355375556 0.87005097409399
Output for 5.5.36
0.93611029759625 0.8373696185992
Output for 5.5.35
0.98133784487246 0.8832899531494
Output for 5.5.34
0.9711036036036 0.86898648648649
Output for 5.5.33
0.9878269284641 0.87145694858278
Output for 5.5.32
1.036832530082 0.86392071750024
Output for 5.5.31
0.99398057694518 0.8896247557752
Output for 5.5.30
1.0874468408262 0.94537894896719
Output for 5.5.29
0.96107170221706 0.85402506240886
Output for 5.5.28
0.98583456460048 0.87846806913858
Output for 5.5.27
0.99719899217326 0.81770665808942
Output for 5.5.26
0.98017480543075 0.87359750558543
Output for 5.5.25
0.97973297913756 0.87791696246594
Output for 5.5.24
0.97003046922608 0.84797074954296
Output for 5.5.23
0.99789128922987 0.84470691163605
Output for 5.5.22
0.94169699191036 0.85099615153022
Output for 5.5.21
1.0065452331422 0.88732305038307
Output for 5.5.20
0.97824725742624 0.81657316034664
Output for 5.5.19
0.94383133530288 0.817210733208
Output for 5.5.18
0.98276035383997 0.86454563731403
Output for 5.5.16
1.02402232978 0.8772455978858
Output for 5.5.15
0.9894629503739 0.81975332621152
Output for 5.5.14
0.98013338675088 0.86004996111517
Output for 5.5.13
0.98956528911985 0.87129148450604
Output for 5.5.12
0.99188262717674 0.87461949814891
Output for 5.5.11
0.90090205197659 0.87684307362073
Output for 5.5.10
0.98150025342119 0.86441966548403
Output for 5.5.9
0.98448562387598 0.85037676144512
Output for 5.5.8
0.96913109756098 0.82743609287054
Output for 5.5.7
0.99517951144496 0.86876737446028
Output for 5.5.6
0.96892231035557 0.76781036472549
Output for 5.5.5
0.96088982216681 0.84784653411204
Output for 5.5.4
0.96873895109016 0.83824395992929
Output for 5.5.3
0.98243915205444 0.862457471866
Output for 5.5.2
0.99598393574297 0.87833875183273
Output for 5.5.1
1.0332894953148 0.82526244099481
Output for 5.5.0
0.98407101467143 0.86213783750462
Output for 5.4.45
0.98278013476416 0.86799489781771
Output for 5.4.44
0.96626038921549 0.86034107034259
Output for 5.4.43
0.96688569537676 0.86749550912357
Output for 5.4.42
0.95089612087109 0.83729147743636
Output for 5.4.41
0.9334974257068 0.81360084906513
Output for 5.4.40
0.98047692727769 0.86390734504414
Output for 5.4.39
1.1120026483385 0.88363074594867
Output for 5.4.38
0.98876678133277 0.87820024962708
Output for 5.4.37
0.96393708732753 0.88416653870621
Output for 5.4.36
0.85372678964702 0.76385549471642
Output for 5.4.35
0.97645688158097 0.85885120133653
Output for 5.4.34
0.98414559319805 0.85702546347022
Output for 5.4.32
0.97156498792379 0.86407549870293
Output for 5.4.31
0.96586867159379 0.85166450128858
Output for 5.4.30
0.98514369215782 0.87598636142231
Output for 5.4.29
0.84861995290835 0.77029737507631
Output for 5.4.28
0.96952374730515 0.94437185601359
Output for 5.4.27
0.97702438326096 0.86579663119721
Output for 5.4.26
0.97922774715609 0.98554591298229
Output for 5.4.25
0.9878463060686 0.87508245382586
Output for 5.4.24
1.006999971944 0.88780405689757
Output for 5.4.23
0.97166753418824 0.85789996687645
Output for 5.4.22
0.97978580041138 0.87848428966593
Output for 5.4.21
0.96630957925788 0.85320602390933
Output for 5.4.20
0.98411700851283 0.86897960349654
Output for 5.4.19
0.96197913697771 0.79323661859431
Output for 5.4.18
0.99164705882353 0.8532192513369
Output for 5.4.17
0.88569888125084 0.79440176124365
Output for 5.4.16
0.99607207364046 0.80955541531565
Output for 5.4.15
0.98888256122019 0.8674944908015
Output for 5.4.14
0.96962902568284 0.86658656425001
Output for 5.4.13
0.83327224491221 0.748132439697
Output for 5.4.12
0.97180393022742 0.82927798631044
Output for 5.4.11
0.96228162764147 0.84843719707903
Output for 5.4.10
0.9696467113484 0.83004657503124
Output for 5.4.9
0.9758020663404 0.86102872114291
Output for 5.4.8
1.0823962154469 0.88775632930423
Output for 5.4.7
0.97492005364143 0.88659222199299
Output for 5.4.6
0.96992272505218 0.85653062130834
Output for 5.4.5
0.97202081564221 0.85201515448429
Output for 5.4.4
0.99035041965005 0.82333206885106
Output for 5.4.3
0.88022289145763 0.78904657998666
Output for 5.4.2
0.90383679492614 0.8575095370414
Output for 5.4.1
0.99158091674462 0.8489980798582
Output for 5.4.0
0.83623649078195 0.82983682983683
Output for 5.3.29
0.98204135929375 0.87214294352401
Output for 5.3.28
0.98263156750647 0.87072582222899
Output for 5.3.27
0.98434502603453 0.87198547547273
Output for 5.3.26
0.97662567959935 0.87915310715747
Output for 5.3.25
0.96854754160058 0.85455254173499
Output for 5.3.24
0.91569490026302 0.80152689523544
Output for 5.3.23
0.96696771572104 0.86792627068558
Output for 5.3.22
0.97254096074092 0.87405850737386
Output for 5.3.21
0.97247591280338 0.87423490567859
Output for 5.3.20
0.98085612625789 0.8876034140272
Output for 5.3.19
0.98871526040937 0.88121010824546
Output for 5.3.18
0.97480413966534 0.86283973304962
Output for 5.3.17
0.99276934934285 0.85703999675483
Output for 5.3.16
0.97415296215574 0.87655042599564
Output for 5.3.15
0.96312546172003 0.86642101659489
Output for 5.3.14
0.98064436978597 0.86055641538636
Output for 5.3.13
0.97689453238244 0.85169401441797
Output for 5.3.12
1.0442254266437 0.87071041143008
Output for 5.3.11
0.99375853325532 0.91225375463234
Output for 5.3.10
0.97747983343727 0.89293114200076
Output for 5.3.9
0.94263600617192 0.89373351251804
Output for 5.3.8
0.91958706598451 0.83651493397505
Output for 5.3.7
0.90584664759646 0.79238470662108
Output for 5.3.6
0.98238313759042 0.89206917113894
Output for 5.3.5
1.0215063246485 0.88439248097566
Output for 5.3.4
0.95168844500524 0.85925704142518
Output for 5.3.3
0.98770385336989 0.88626064367153
Output for 5.3.2
0.9968604296994 0.89186054684754
Output for 5.3.1
0.96967425876503 0.87368844368077
Output for 5.3.0
0.93599010660327 0.83044136820308
Output for 5.2.17
0.9437703899332 0.85697529905235
Output for 5.2.16
0.97191423155335 0.81507743481527
Output for 5.2.15
0.96362251071903 0.80280711714
Output for 5.2.14
0.99699935848354 0.83100180038491
Output for 5.2.13
0.95522927923938 0.80305311955591
Output for 5.2.12
0.99475124312663 0.89472230261254
Output for 5.2.11
1.0045131681679 0.87544036714718
Output for 5.2.10
0.8775172119456 0.74948055302852
Output for 5.2.9
0.92881429161814 0.83871210128865
Output for 5.2.8
0.95396802992343 0.80286001623205
Output for 5.2.7
0.98348818255909 0.90903830480848
Output for 5.2.6
0.9963474652954 0.83291033082474
Output for 5.2.5
0.95505223880597 0.85313432835821
Output for 5.2.4
0.97708484738372 0.84248955305233
Output for 5.2.3
0.96491455204557 0.85063870188158
Output for 5.2.2
0.98256908156939 0.77865113807457
Output for 4.4.9
0.93139803581745 0.66658542749856
Output for 4.4.8
0.85922205709015 0.63615709185329