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";
Output for 7.1.0
Variable Instantiation takes 0.00083804130554199 seconds Magic Instantiation takes 0.00072693824768066 seconds
Output for 7.0.14
Variable Instantiation takes 0.0015709400177002 seconds Magic Instantiation takes 0.0013411045074463 seconds
Output for 7.0.12
Variable Instantiation takes 0.001655101776123 seconds Magic Instantiation takes 0.0013978481292725 seconds
Output for 7.0.6
Variable Instantiation takes 0.0014340877532959 seconds Magic Instantiation takes 0.0012171268463135 seconds
Output for 7.0.5
Variable Instantiation takes 0.0015039443969727 seconds Magic Instantiation takes 0.0013270378112793 seconds
Output for 7.0.4
Variable Instantiation takes 0.0011091232299805 seconds Magic Instantiation takes 0.00094103813171387 seconds
Output for 7.0.3
Variable Instantiation takes 0.0011851787567139 seconds Magic Instantiation takes 0.00097298622131348 seconds
Output for 7.0.2
Variable Instantiation takes 0.0011980533599854 seconds Magic Instantiation takes 0.00089693069458008 seconds
Output for 7.0.1
Variable Instantiation takes 0.0012640953063965 seconds Magic Instantiation takes 0.0010569095611572 seconds
Output for 7.0.0
Variable Instantiation takes 0.001255989074707 seconds Magic Instantiation takes 0.0010929107666016 seconds
Output for hhvm-3.12.0
Variable Instantiation takes 0.0035421848297119 seconds Magic Instantiation takes 0.0032410621643066 seconds
Output for hhvm-3.10.0
Variable Instantiation takes 0.0038819313049316 seconds Magic Instantiation takes 0.0037400722503662 seconds
Output for 5.6.28
Variable Instantiation takes 0.0040061473846436 seconds Magic Instantiation takes 0.0032520294189453 seconds
Output for 5.6.21
Variable Instantiation takes 0.0021729469299316 seconds Magic Instantiation takes 0.0015108585357666 seconds
Output for 5.6.20
Variable Instantiation takes 0.0035569667816162 seconds Magic Instantiation takes 0.0024459362030029 seconds
Output for 5.6.19
Variable Instantiation takes 0.0033960342407227 seconds Magic Instantiation takes 0.0024948120117188 seconds
Output for 5.6.18
Variable Instantiation takes 0.0029881000518799 seconds Magic Instantiation takes 0.0021650791168213 seconds
Output for 5.6.17
Variable Instantiation takes 0.0029430389404297 seconds Magic Instantiation takes 0.0019750595092773 seconds
Output for 5.6.16
Variable Instantiation takes 0.0022640228271484 seconds Magic Instantiation takes 0.0015590190887451 seconds
Output for 5.6.15
Variable Instantiation takes 0.0032269954681396 seconds Magic Instantiation takes 0.0020818710327148 seconds
Output for 5.6.14
Variable Instantiation takes 0.0035760402679443 seconds Magic Instantiation takes 0.0024399757385254 seconds
Output for 5.6.13
Variable Instantiation takes 0.0022850036621094 seconds Magic Instantiation takes 0.0018110275268555 seconds
Output for 5.6.12
Variable Instantiation takes 0.0032000541687012 seconds Magic Instantiation takes 0.0024080276489258 seconds
Output for 5.6.11
Variable Instantiation takes 0.0030949115753174 seconds Magic Instantiation takes 0.0021660327911377 seconds
Output for 5.6.10
Variable Instantiation takes 0.0035331249237061 seconds Magic Instantiation takes 0.0024900436401367 seconds
Output for 5.6.9
Variable Instantiation takes 0.0034539699554443 seconds Magic Instantiation takes 0.0023550987243652 seconds
Output for 5.6.8
Variable Instantiation takes 0.0021982192993164 seconds Magic Instantiation takes 0.0015580654144287 seconds
Output for 5.6.7
Variable Instantiation takes 0.0022320747375488 seconds Magic Instantiation takes 0.0015590190887451 seconds
Output for 5.5.35
Variable Instantiation takes 0.0023670196533203 seconds Magic Instantiation takes 0.0017030239105225 seconds
Output for 5.5.34
Variable Instantiation takes 0.0022060871124268 seconds Magic Instantiation takes 0.0016310214996338 seconds
Output for 5.5.33
Variable Instantiation takes 0.002316951751709 seconds Magic Instantiation takes 0.001662015914917 seconds
Output for 5.5.32
Variable Instantiation takes 0.0033841133117676 seconds Magic Instantiation takes 0.0028719902038574 seconds
Output for 5.5.31
Variable Instantiation takes 0.0024888515472412 seconds Magic Instantiation takes 0.0018339157104492 seconds
Output for 5.5.30
Variable Instantiation takes 0.0024700164794922 seconds Magic Instantiation takes 0.0016889572143555 seconds
Output for 5.5.29
Variable Instantiation takes 0.0030608177185059 seconds Magic Instantiation takes 0.0021431446075439 seconds
Output for 5.5.28
Variable Instantiation takes 0.0022978782653809 seconds Magic Instantiation takes 0.0016589164733887 seconds
Output for 5.5.27
Variable Instantiation takes 0.0024371147155762 seconds Magic Instantiation takes 0.0017862319946289 seconds
Output for 5.5.26
Variable Instantiation takes 0.0025382041931152 seconds Magic Instantiation takes 0.0019609928131104 seconds
Output for 5.5.25
Variable Instantiation takes 0.0037059783935547 seconds Magic Instantiation takes 0.002622127532959 seconds
Output for 5.5.24
Variable Instantiation takes 0.0035018920898438 seconds Magic Instantiation takes 0.0024960041046143 seconds
Output for 5.4.45
Variable Instantiation takes 0.0034799575805664 seconds Magic Instantiation takes 0.0024650096893311 seconds
Output for 5.4.44
Variable Instantiation takes 0.0035388469696045 seconds Magic Instantiation takes 0.0024669170379639 seconds
Output for 5.4.43
Variable Instantiation takes 0.0035698413848877 seconds Magic Instantiation takes 0.0025649070739746 seconds
Output for 5.4.42
Variable Instantiation takes 0.0022730827331543 seconds Magic Instantiation takes 0.0016658306121826 seconds
Output for 5.4.41
Variable Instantiation takes 0.0027270317077637 seconds Magic Instantiation takes 0.0019690990447998 seconds
Output for 5.4.40
Variable Instantiation takes 0.0023210048675537 seconds Magic Instantiation takes 0.0016920566558838 seconds
Output for 5.4.39
Variable Instantiation takes 0.0023071765899658 seconds Magic Instantiation takes 0.0016491413116455 seconds
Output for 5.4.38
Variable Instantiation takes 0.0035271644592285 seconds Magic Instantiation takes 0.0024950504302979 seconds
Output for 5.4.37
Variable Instantiation takes 0.0033340454101562 seconds Magic Instantiation takes 0.0023880004882812 seconds
Output for 5.4.36
Variable Instantiation takes 0.0034530162811279 seconds Magic Instantiation takes 0.0024840831756592 seconds
Output for 5.4.35
Variable Instantiation takes 0.0029821395874023 seconds Magic Instantiation takes 0.0021090507507324 seconds
Output for 5.4.34
Variable Instantiation takes 0.0038988590240479 seconds Magic Instantiation takes 0.0022878646850586 seconds
Output for 5.4.32
Variable Instantiation takes 0.0034370422363281 seconds Magic Instantiation takes 0.0023550987243652 seconds
Output for 5.4.31
Variable Instantiation takes 0.0030591487884521 seconds Magic Instantiation takes 0.0021190643310547 seconds
Output for 5.4.30
Variable Instantiation takes 0.0028321743011475 seconds Magic Instantiation takes 0.0020999908447266 seconds
Output for 5.4.29
Variable Instantiation takes 0.0036590099334717 seconds Magic Instantiation takes 0.0025639533996582 seconds
Output for 5.4.28
Variable Instantiation takes 0.0034520626068115 seconds Magic Instantiation takes 0.0024950504302979 seconds
Output for 5.4.27
Variable Instantiation takes 0.0034680366516113 seconds Magic Instantiation takes 0.0026140213012695 seconds
Output for 5.4.26
Variable Instantiation takes 0.0031599998474121 seconds Magic Instantiation takes 0.002126932144165 seconds
Output for 5.4.25
Variable Instantiation takes 0.0029451847076416 seconds Magic Instantiation takes 0.0021100044250488 seconds
Output for 5.4.24
Variable Instantiation takes 0.0025889873504639 seconds Magic Instantiation takes 0.0018851757049561 seconds
Output for 5.4.23
Variable Instantiation takes 0.0039060115814209 seconds Magic Instantiation takes 0.0024499893188477 seconds
Output for 5.4.22
Variable Instantiation takes 0.0024478435516357 seconds Magic Instantiation takes 0.0017759799957275 seconds
Output for 5.4.21
Variable Instantiation takes 0.0030019283294678 seconds Magic Instantiation takes 0.0021829605102539 seconds
Output for 5.4.20
Variable Instantiation takes 0.0027081966400146 seconds Magic Instantiation takes 0.0019450187683105 seconds
Output for 5.4.19
Variable Instantiation takes 0.0023179054260254 seconds Magic Instantiation takes 0.0016820430755615 seconds
Output for 5.4.18
Variable Instantiation takes 0.0023629665374756 seconds Magic Instantiation takes 0.0017321109771729 seconds
Output for 5.4.17
Variable Instantiation takes 0.0023238658905029 seconds Magic Instantiation takes 0.0016810894012451 seconds
Output for 5.4.16
Variable Instantiation takes 0.0026481151580811 seconds Magic Instantiation takes 0.0023698806762695 seconds
Output for 5.4.15
Variable Instantiation takes 0.0033009052276611 seconds Magic Instantiation takes 0.0028128623962402 seconds
Output for 5.4.14
Variable Instantiation takes 0.0022659301757812 seconds Magic Instantiation takes 0.0016298294067383 seconds
Output for 5.4.13
Variable Instantiation takes 0.0030810832977295 seconds Magic Instantiation takes 0.0022509098052979 seconds
Output for 5.4.12
Variable Instantiation takes 0.002202033996582 seconds Magic Instantiation takes 0.0015969276428223 seconds
Output for 5.4.11
Variable Instantiation takes 0.0023119449615479 seconds Magic Instantiation takes 0.0016379356384277 seconds
Output for 5.4.10
Variable Instantiation takes 0.002263069152832 seconds Magic Instantiation takes 0.0016069412231445 seconds
Output for 5.4.9
Variable Instantiation takes 0.0033359527587891 seconds Magic Instantiation takes 0.0029380321502686 seconds
Output for 5.4.8
Variable Instantiation takes 0.002838134765625 seconds Magic Instantiation takes 0.0019838809967041 seconds
Output for 5.4.7
Variable Instantiation takes 0.0023200511932373 seconds Magic Instantiation takes 0.0016169548034668 seconds
Output for 5.4.6
Variable Instantiation takes 0.0022590160369873 seconds Magic Instantiation takes 0.0015859603881836 seconds
Output for 5.4.5
Variable Instantiation takes 0.0022780895233154 seconds Magic Instantiation takes 0.0016269683837891 seconds
Output for 5.4.4
Variable Instantiation takes 0.0022389888763428 seconds Magic Instantiation takes 0.0016078948974609 seconds
Output for 5.4.3
Variable Instantiation takes 0.0022962093353271 seconds Magic Instantiation takes 0.0016460418701172 seconds
Output for 5.4.2
Variable Instantiation takes 0.0022079944610596 seconds Magic Instantiation takes 0.0016129016876221 seconds
Output for 5.4.1
Variable Instantiation takes 0.002316951751709 seconds Magic Instantiation takes 0.0016341209411621 seconds
Output for 5.4.0
Variable Instantiation takes 0.0023598670959473 seconds Magic Instantiation takes 0.0016779899597168 seconds
Output for 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/1h8Jp 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/1h8Jp 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/1h8Jp 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/1h8Jp 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/1h8Jp on line 3
Process exited with code 255.