3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { public function bar() { return ""; } } $ts = microtime(true); for ($i=1; $i<=10000; $i++) { $c = new Foo(); echo $c->bar(); unset ($c); } $tt = microtime(true); $t1 = $tt-$ts; unset($ts, $tt); echo "Variable Instantiation takes {$t1} seconds\n"; $ts = microtime(true); for ($i=1; $i<=10000; $i++) { echo (new Foo())->bar(); } $tt = microtime(true); $t2 = $tt-$ts; unset($ts, $tt); echo "Magic Instantiation takes {$t2} seconds\n"; echo "\n"; if ($t1 < $t2) { echo "Variable Instantion is faster by a factor of ".(($t2*100)/$t1)."\n"; } else { echo "Magic Instantion is faster by a factor of ".(($t1*100)/$t2)."\n"; }
Output for 7.1.0
Variable Instantiation takes 0.00083208084106445 seconds Magic Instantiation takes 0.00070881843566895 seconds Magic Instantion is faster by a factor of 117.38984191053
Output for 7.0.14
Variable Instantiation takes 0.0016739368438721 seconds Magic Instantiation takes 0.0015327930450439 seconds Magic Instantion is faster by a factor of 109.20827500389
Output for 7.0.12
Variable Instantiation takes 0.0015289783477783 seconds Magic Instantiation takes 0.0012710094451904 seconds Magic Instantion is faster by a factor of 120.2963796661
Output for 7.0.6
Variable Instantiation takes 0.00099992752075195 seconds Magic Instantiation takes 0.00083398818969727 seconds Magic Instantion is faster by a factor of 119.89708404803
Output for 7.0.5
Variable Instantiation takes 0.0012450218200684 seconds Magic Instantiation takes 0.0010781288146973 seconds Magic Instantion is faster by a factor of 115.47987616099
Output for 7.0.4
Variable Instantiation takes 0.0011770725250244 seconds Magic Instantiation takes 0.00096988677978516 seconds Magic Instantion is faster by a factor of 121.36184857424
Output for 7.0.3
Variable Instantiation takes 0.00092601776123047 seconds Magic Instantiation takes 0.00079011917114258 seconds Magic Instantion is faster by a factor of 117.19975859988
Output for 7.0.2
Variable Instantiation takes 0.0017421245574951 seconds Magic Instantiation takes 0.00164794921875 seconds Magic Instantion is faster by a factor of 105.71469907407
Output for 7.0.1
Variable Instantiation takes 0.001317024230957 seconds Magic Instantiation takes 0.0010941028594971 seconds Magic Instantion is faster by a factor of 120.37480932665
Output for 7.0.0
Variable Instantiation takes 0.0013270378112793 seconds Magic Instantiation takes 0.0010910034179688 seconds Magic Instantion is faster by a factor of 121.63461538462
Output for 5.6.28
Variable Instantiation takes 0.0040538311004639 seconds Magic Instantiation takes 0.0032799243927002 seconds Magic Instantion is faster by a factor of 123.59526059461
Output for 5.6.21
Variable Instantiation takes 0.0036771297454834 seconds Magic Instantiation takes 0.0025830268859863 seconds Magic Instantion is faster by a factor of 142.35739339118
Output for 5.6.20
Variable Instantiation takes 0.0035350322723389 seconds Magic Instantiation takes 0.0023469924926758 seconds Magic Instantion is faster by a factor of 150.61966680211
Output for 5.6.19
Variable Instantiation takes 0.0021820068359375 seconds Magic Instantiation takes 0.0015091896057129 seconds Magic Instantion is faster by a factor of 144.58135860979
Output for 5.6.18
Variable Instantiation takes 0.0032739639282227 seconds Magic Instantiation takes 0.0019369125366211 seconds Magic Instantion is faster by a factor of 169.03003446578
Output for 5.6.17
Variable Instantiation takes 0.0032639503479004 seconds Magic Instantiation takes 0.0022671222686768 seconds Magic Instantion is faster by a factor of 143.96887159533
Output for 5.6.16
Variable Instantiation takes 0.0032989978790283 seconds Magic Instantiation takes 0.0022449493408203 seconds Magic Instantion is faster by a factor of 146.95199660153
Output for 5.6.15
Variable Instantiation takes 0.0035130977630615 seconds Magic Instantiation takes 0.0024151802062988 seconds Magic Instantion is faster by a factor of 145.45903257651
Output for 5.6.14
Variable Instantiation takes 0.0023190975189209 seconds Magic Instantiation takes 0.0016310214996338 seconds Magic Instantion is faster by a factor of 142.18681479316
Output for 5.6.13
Variable Instantiation takes 0.0021579265594482 seconds Magic Instantiation takes 0.0015511512756348 seconds Magic Instantion is faster by a factor of 139.1177374731
Output for 5.6.12
Variable Instantiation takes 0.0028340816497803 seconds Magic Instantiation takes 0.0028340816497803 seconds Magic Instantion is faster by a factor of 100
Output for 5.6.11
Variable Instantiation takes 0.0036299228668213 seconds Magic Instantiation takes 0.0023729801177979 seconds Magic Instantion is faster by a factor of 152.9689540842
Output for 5.6.10
Variable Instantiation takes 0.0036690235137939 seconds Magic Instantiation takes 0.0025680065155029 seconds Magic Instantion is faster by a factor of 142.87438492248
Output for 5.6.9
Variable Instantiation takes 0.0035228729248047 seconds Magic Instantiation takes 0.0025649070739746 seconds Magic Instantion is faster by a factor of 137.34894961889
Output for 5.6.8
Variable Instantiation takes 0.0034880638122559 seconds Magic Instantiation takes 0.0024569034576416 seconds Magic Instantion is faster by a factor of 141.96991751577
Output for 5.5.35
Variable Instantiation takes 0.0023038387298584 seconds Magic Instantiation takes 0.0016510486602783 seconds Magic Instantion is faster by a factor of 139.53790613718
Output for 5.5.34
Variable Instantiation takes 0.0032930374145508 seconds Magic Instantiation takes 0.0024151802062988 seconds Magic Instantion is faster by a factor of 136.34748272458
Output for 5.5.33
Variable Instantiation takes 0.0035929679870605 seconds Magic Instantiation takes 0.0024681091308594 seconds Magic Instantion is faster by a factor of 145.57573415765
Output for 5.5.32
Variable Instantiation takes 0.0031869411468506 seconds Magic Instantiation takes 0.0023360252380371 seconds Magic Instantion is faster by a factor of 136.42580118392
Output for 5.5.31
Variable Instantiation takes 0.0031919479370117 seconds Magic Instantiation takes 0.0022170543670654 seconds Magic Instantion is faster by a factor of 143.97247015808
Output for 5.5.30
Variable Instantiation takes 0.0024139881134033 seconds Magic Instantiation takes 0.0016818046569824 seconds Magic Instantion is faster by a factor of 143.53558264814
Output for 5.5.29
Variable Instantiation takes 0.0034730434417725 seconds Magic Instantiation takes 0.0024330615997314 seconds Magic Instantion is faster by a factor of 142.74375306222
Output for 5.5.28
Variable Instantiation takes 0.0031940937042236 seconds Magic Instantiation takes 0.0022819042205811 seconds Magic Instantion is faster by a factor of 139.97492425034
Output for 5.5.27
Variable Instantiation takes 0.0037710666656494 seconds Magic Instantiation takes 0.0026240348815918 seconds Magic Instantion is faster by a factor of 143.71252044339
Output for 5.5.26
Variable Instantiation takes 0.0033221244812012 seconds Magic Instantiation takes 0.0025172233581543 seconds Magic Instantion is faster by a factor of 131.97575298352
Output for 5.5.25
Variable Instantiation takes 0.0034859180450439 seconds Magic Instantiation takes 0.002647876739502 seconds Magic Instantion is faster by a factor of 131.64955879705
Output for 5.5.24
Variable Instantiation takes 0.0028328895568848 seconds Magic Instantiation takes 0.0020298957824707 seconds Magic Instantion is faster by a factor of 139.5583744421
Output for 5.4.45
Variable Instantiation takes 0.0035979747772217 seconds Magic Instantiation takes 0.0026252269744873 seconds Magic Instantion is faster by a factor of 137.05385523567
Output for 5.4.44
Variable Instantiation takes 0.0041019916534424 seconds Magic Instantiation takes 0.0041599273681641 seconds Variable Instantion is faster by a factor of 101.41238012206
Output for 5.4.43
Variable Instantiation takes 0.0023181438446045 seconds Magic Instantiation takes 0.0016539096832275 seconds Magic Instantion is faster by a factor of 140.1614530777
Output for 5.4.42
Variable Instantiation takes 0.0026819705963135 seconds Magic Instantiation takes 0.0020210742950439 seconds Magic Instantion is faster by a factor of 132.70024772915
Output for 5.4.41
Variable Instantiation takes 0.0036089420318604 seconds Magic Instantiation takes 0.0026199817657471 seconds Magic Instantion is faster by a factor of 137.74683774684
Output for 5.4.40
Variable Instantiation takes 0.0037989616394043 seconds Magic Instantiation takes 0.0025770664215088 seconds Magic Instantion is faster by a factor of 147.41419187714
Output for 5.4.39
Variable Instantiation takes 0.0035080909729004 seconds Magic Instantiation takes 0.002446174621582 seconds Magic Instantion is faster by a factor of 143.41130604289
Output for 5.4.38
Variable Instantiation takes 0.0038790702819824 seconds Magic Instantiation takes 0.0027108192443848 seconds Magic Instantion is faster by a factor of 143.09586631486
Output for 5.4.37
Variable Instantiation takes 0.0038671493530273 seconds Magic Instantiation takes 0.0026569366455078 seconds Magic Instantion is faster by a factor of 145.54917444365
Output for 5.4.36
Variable Instantiation takes 0.0036289691925049 seconds Magic Instantiation takes 0.0025739669799805 seconds Magic Instantion is faster by a factor of 140.98740274176
Output for 5.4.35
Variable Instantiation takes 0.0037150382995605 seconds Magic Instantiation takes 0.0024669170379639 seconds Magic Instantion is faster by a factor of 150.59437518121
Output for 5.4.34
Variable Instantiation takes 0.003507137298584 seconds Magic Instantiation takes 0.0025060176849365 seconds Magic Instantion is faster by a factor of 139.94862524974
Output for 5.4.32
Variable Instantiation takes 0.0036218166351318 seconds Magic Instantiation takes 0.0025818347930908 seconds Magic Instantion is faster by a factor of 140.28072767569
Output for 5.4.31
Variable Instantiation takes 0.0034809112548828 seconds Magic Instantiation takes 0.0024528503417969 seconds Magic Instantion is faster by a factor of 141.91290824261
Output for 5.4.30
Variable Instantiation takes 0.0029819011688232 seconds Magic Instantiation takes 0.0020480155944824 seconds Magic Instantion is faster by a factor of 145.59953434226
Output for 5.4.29
Variable Instantiation takes 0.002953052520752 seconds Magic Instantiation takes 0.0028131008148193 seconds Magic Instantion is faster by a factor of 104.97499788118
Output for 5.4.28
Variable Instantiation takes 0.0036299228668213 seconds Magic Instantiation takes 0.0026471614837646 seconds Magic Instantion is faster by a factor of 137.12510132397
Output for 5.4.27
Variable Instantiation takes 0.0032870769500732 seconds Magic Instantiation takes 0.0024428367614746 seconds Magic Instantion is faster by a factor of 134.55982822565
Output for 5.4.26
Variable Instantiation takes 0.0037631988525391 seconds Magic Instantiation takes 0.0030429363250732 seconds Magic Instantion is faster by a factor of 123.66998354619
Output for 5.4.25
Variable Instantiation takes 0.002331018447876 seconds Magic Instantiation takes 0.0016789436340332 seconds Magic Instantion is faster by a factor of 138.83839818233
Output for 5.4.24
Variable Instantiation takes 0.0028440952301025 seconds Magic Instantiation takes 0.0026319026947021 seconds Magic Instantion is faster by a factor of 108.06232448591
Output for 5.4.23
Variable Instantiation takes 0.0026919841766357 seconds Magic Instantiation takes 0.0019428730010986 seconds Magic Instantion is faster by a factor of 138.55687814456
Output for 5.4.22
Variable Instantiation takes 0.0038261413574219 seconds Magic Instantiation takes 0.0027661323547363 seconds Magic Instantion is faster by a factor of 138.32097914153
Output for 5.4.21
Variable Instantiation takes 0.0040390491485596 seconds Magic Instantiation takes 0.0027759075164795 seconds Magic Instantion is faster by a factor of 145.50373615048
Output for 5.4.20
Variable Instantiation takes 0.003835916519165 seconds Magic Instantiation takes 0.0027320384979248 seconds Magic Instantion is faster by a factor of 140.40492189545
Output for 5.4.19
Variable Instantiation takes 0.002814769744873 seconds Magic Instantiation takes 0.0020639896392822 seconds Magic Instantion is faster by a factor of 136.37518770937
Output for 5.4.18
Variable Instantiation takes 0.0023369789123535 seconds Magic Instantiation takes 0.0016570091247559 seconds Magic Instantion is faster by a factor of 141.03597122302
Output for 5.4.17
Variable Instantiation takes 0.0039479732513428 seconds Magic Instantiation takes 0.0027129650115967 seconds Magic Instantion is faster by a factor of 145.52245364268
Output for 5.4.16
Variable Instantiation takes 0.0030028820037842 seconds Magic Instantiation takes 0.0041589736938477 seconds Variable Instantion is faster by a factor of 138.49940452561
Output for 5.4.15
Variable Instantiation takes 0.0028159618377686 seconds Magic Instantiation takes 0.0020239353179932 seconds Magic Instantion is faster by a factor of 139.13299564142
Output for 5.4.14
Variable Instantiation takes 0.0037949085235596 seconds Magic Instantiation takes 0.0025448799133301 seconds Magic Instantion is faster by a factor of 149.11935544313
Output for 5.4.13
Variable Instantiation takes 0.0026919841766357 seconds Magic Instantiation takes 0.0018551349639893 seconds Magic Instantion is faster by a factor of 145.10988304845
Output for 5.4.12
Variable Instantiation takes 0.0023500919342041 seconds Magic Instantiation takes 0.0016970634460449 seconds Magic Instantion is faster by a factor of 138.4799100871
Output for 5.4.11
Variable Instantiation takes 0.0038430690765381 seconds Magic Instantiation takes 0.0027091503143311 seconds Magic Instantion is faster by a factor of 141.85514388806
Output for 5.4.10
Variable Instantiation takes 0.003673791885376 seconds Magic Instantiation takes 0.0026330947875977 seconds Magic Instantion is faster by a factor of 139.52372328866
Output for 5.4.9
Variable Instantiation takes 0.0034801959991455 seconds Magic Instantiation takes 0.002655029296875 seconds Magic Instantion is faster by a factor of 131.07938218391
Output for 5.4.8
Variable Instantiation takes 0.0023279190063477 seconds Magic Instantiation takes 0.0016980171203613 seconds Magic Instantion is faster by a factor of 137.09632125807
Output for 5.4.7
Variable Instantiation takes 0.0035200119018555 seconds Magic Instantiation takes 0.0024268627166748 seconds Magic Instantion is faster by a factor of 145.04371745751
Output for 5.4.6
Variable Instantiation takes 0.003777027130127 seconds Magic Instantiation takes 0.0025827884674072 seconds Magic Instantion is faster by a factor of 146.23834579526
Output for 5.4.5
Variable Instantiation takes 0.0038599967956543 seconds Magic Instantiation takes 0.0027098655700684 seconds Magic Instantion is faster by a factor of 142.44237198663
Output for 5.4.4
Variable Instantiation takes 0.003795862197876 seconds Magic Instantiation takes 0.0027408599853516 seconds Magic Instantion is faster by a factor of 138.49164926931
Output for 5.4.3
Variable Instantiation takes 0.0037059783935547 seconds Magic Instantiation takes 0.0025999546051025 seconds Magic Instantion is faster by a factor of 142.54011921137
Output for 5.4.2
Variable Instantiation takes 0.0038349628448486 seconds Magic Instantiation takes 0.0027091503143311 seconds Magic Instantion is faster by a factor of 141.55592713192
Output for 5.4.1
Variable Instantiation takes 0.0033001899719238 seconds Magic Instantiation takes 0.0023767948150635 seconds Magic Instantion is faster by a factor of 138.85043635269
Output for 5.4.0
Variable Instantiation takes 0.0035059452056885 seconds Magic Instantiation takes 0.0025019645690918 seconds Magic Instantion is faster by a factor of 140.12769201448
Output for 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/sa2QT on line 22
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/sa2QT on line 22
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/sa2QT on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/sa2QT on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/sa2QT on line 3
Process exited with code 255.