3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Bar { } class Foo { private $bar; public function __construct(Bar $bar) { $this->bar = $bar; } } $bar = new Bar; $t1 = microtime(true); for ($i = 0; $i < 10000; $i++) { $reflect = new ReflectionClass('foo'); $constructor = $reflect->getConstructor(); } $t2 = microtime(true); echo 'getcons ' . ($t2-$t1) . '<br />'; $t1 = microtime(true); for ($i = 0; $i < 10000; $i++) { $constructor = method_exists('Foo', '__construct') ? new ReflectionMethod('Foo', '__construct') : null; } $t2 = microtime(true); echo 'rm: ' . ($t2-$t1) . '<br />';
based on oXneA
Output for 7.1.0
getcons 0.0064311027526855<br />rm: 0.0062439441680908<br />
Output for 7.0.14
getcons 0.006026029586792<br />rm: 0.0052890777587891<br />
Output for 7.0.6
getcons 0.0064311027526855<br />rm: 0.004784107208252<br />
Output for 7.0.5
getcons 0.0034232139587402<br />rm: 0.0038847923278809<br />
Output for 7.0.4
getcons 0.0043869018554688<br />rm: 0.0044610500335693<br />
Output for 7.0.3
getcons 0.0039470195770264<br />rm: 0.0042269229888916<br />
Output for 7.0.2
getcons 0.0036430358886719<br />rm: 0.0039060115814209<br />
Output for 7.0.1
getcons 0.0045828819274902<br />rm: 0.0048720836639404<br />
Output for 7.0.0
getcons 0.0041530132293701<br />rm: 0.0047109127044678<br />
Output for hhvm-3.12.0
getcons 0.04737401008606<br />rm: 0.029567956924438<br />
Output for hhvm-3.10.0
getcons 0.028970956802368<br />rm: 0.015395164489746<br />
Output for 5.6.28
getcons 0.011243104934692<br />rm: 0.012044906616211<br />
Output for 5.6.21
getcons 0.0076189041137695<br />rm: 0.0079381465911865<br />
Output for 5.6.20
getcons 0.0097529888153076<br />rm: 0.01034688949585<br />
Output for 5.6.19
getcons 0.0071201324462891<br />rm: 0.0069539546966553<br />
Output for 5.6.18
getcons 0.0063631534576416<br />rm: 0.0065910816192627<br />
Output for 5.6.17
getcons 0.0066518783569336<br />rm: 0.007220983505249<br />
Output for 5.6.16
getcons 0.01301908493042<br />rm: 0.0066919326782227<br />
Output for 5.6.15
getcons 0.01017689704895<br />rm: 0.010111808776855<br />
Output for 5.6.14
getcons 0.010998964309692<br />rm: 0.01007604598999<br />
Output for 5.6.13
getcons 0.0070960521697998<br />rm: 0.0073370933532715<br />
Output for 5.6.12
getcons 0.0078940391540527<br />rm: 0.0083301067352295<br />
Output for 5.6.11
getcons 0.010900974273682<br />rm: 0.010641098022461<br />
Output for 5.6.10
getcons 0.0077691078186035<br />rm: 0.0080609321594238<br />
Output for 5.6.9
getcons 0.0091040134429932<br />rm: 0.0098822116851807<br />
Output for 5.6.8
getcons 0.011080026626587<br />rm: 0.011054992675781<br />
Output for 5.5.35
getcons 0.008310079574585<br />rm: 0.0089390277862549<br />
Output for 5.5.34
getcons 0.0090930461883545<br />rm: 0.010359048843384<br />
Output for 5.5.33
getcons 0.0082859992980957<br />rm: 0.0084788799285889<br />
Output for 5.5.32
getcons 0.0075201988220215<br />rm: 0.0088250637054443<br />
Output for 5.5.31
getcons 0.0065100193023682<br />rm: 0.0073800086975098<br />
Output for 5.5.30
getcons 0.0095729827880859<br />rm: 0.0092980861663818<br />
Output for 5.5.29
getcons 0.0085699558258057<br />rm: 0.0094900131225586<br />
Output for 5.5.28
getcons 0.006479024887085<br />rm: 0.0075039863586426<br />
Output for 5.5.27
getcons 0.006458044052124<br />rm: 0.0073668956756592<br />
Output for 5.5.26
getcons 0.0091118812561035<br />rm: 0.0096499919891357<br />
Output for 5.5.25
getcons 0.0066728591918945<br />rm: 0.0071060657501221<br />
Output for 5.5.24
getcons 0.0090901851654053<br />rm: 0.0088400840759277<br />
Output for 5.4.45
getcons 0.0096199512481689<br />rm: 0.011468887329102<br />
Output for 5.4.44
getcons 0.010699987411499<br />rm: 0.012824058532715<br />
Output for 5.4.43
getcons 0.024266958236694<br />rm: 0.020149946212769<br />
Output for 5.4.42
getcons 0.019651889801025<br />rm: 0.020427942276001<br />
Output for 5.4.41
getcons 0.024099826812744<br />rm: 0.027807950973511<br />
Output for 5.4.40
getcons 0.021466970443726<br />rm: 0.021761894226074<br />
Output for 5.4.39
getcons 0.011490821838379<br />rm: 0.011003971099854<br />
Output for 5.4.38
getcons 0.0099461078643799<br />rm: 0.011276960372925<br />
Output for 5.4.37
getcons 0.0075809955596924<br />rm: 0.0082600116729736<br />
Output for 5.4.36
getcons 0.015294075012207<br />rm: 0.015302896499634<br />
Output for 5.4.35
getcons 0.009207010269165<br />rm: 0.01181697845459<br />
Output for 5.4.34
getcons 0.02025318145752<br />rm: 0.014163970947266<br />
Output for 5.4.32
getcons 0.0076191425323486<br />rm: 0.0088329315185547<br />
Output for 5.4.31
getcons 0.0069820880889893<br />rm: 0.0079669952392578<br />
Output for 5.4.30
getcons 0.0071258544921875<br />rm: 0.0079400539398193<br />
Output for 5.4.29
getcons 0.0079638957977295<br />rm: 0.0083520412445068<br />
Output for 5.4.28
getcons 0.0078489780426025<br />rm: 0.0084271430969238<br />
Output for 5.4.27
getcons 0.0098679065704346<br />rm: 0.0098700523376465<br />
Output for 5.4.26
getcons 0.0087239742279053<br />rm: 0.0091280937194824<br />
Output for 5.4.25
getcons 0.007533073425293<br />rm: 0.0090179443359375<br />
Output for 5.4.24
getcons 0.0086400508880615<br />rm: 0.0092458724975586<br />
Output for 5.4.23
getcons 0.0089559555053711<br />rm: 0.0087430477142334<br />
Output for 5.4.22
getcons 0.0095310211181641<br />rm: 0.0090360641479492<br />
Output for 5.4.21
getcons 0.0074119567871094<br />rm: 0.0082759857177734<br />
Output for 5.4.20
getcons 0.0084860324859619<br />rm: 0.0094120502471924<br />
Output for 5.4.19
getcons 0.0083479881286621<br />rm: 0.0084030628204346<br />
Output for 5.4.18
getcons 0.0087509155273438<br />rm: 0.0091030597686768<br />
Output for 5.4.17
getcons 0.0078699588775635<br />rm: 0.0089831352233887<br />
Output for 5.4.16
getcons 0.0079169273376465<br />rm: 0.0091869831085205<br />
Output for 5.4.15
getcons 0.011842966079712<br />rm: 0.0092380046844482<br />
Output for 5.4.14
getcons 0.0083258152008057<br />rm: 0.008558988571167<br />
Output for 5.4.13
getcons 0.007436990737915<br />rm: 0.0081369876861572<br />
Output for 5.4.12
getcons 0.0082161426544189<br />rm: 0.0090229511260986<br />
Output for 5.4.11
getcons 0.0079760551452637<br />rm: 0.0087649822235107<br />
Output for 5.4.10
getcons 0.0079929828643799<br />rm: 0.0091860294342041<br />
Output for 5.4.9
getcons 0.0087020397186279<br />rm: 0.009512186050415<br />
Output for 5.4.8
getcons 0.0080521106719971<br />rm: 0.0088570117950439<br />
Output for 5.4.7
getcons 0.014787912368774<br />rm: 0.019690990447998<br />
Output for 5.4.6
getcons 0.007681131362915<br />rm: 0.0090339183807373<br />
Output for 5.4.5
getcons 0.01230788230896<br />rm: 0.014364004135132<br />
Output for 5.4.4
getcons 0.020288228988647<br />rm: 0.0099170207977295<br />
Output for 5.4.3
getcons 0.0087888240814209<br />rm: 0.009221076965332<br />
Output for 5.4.2
getcons 0.0086588859558105<br />rm: 0.0094430446624756<br />
Output for 5.4.1
getcons 0.017077922821045<br />rm: 0.018123149871826<br />
Output for 5.4.0
getcons 0.019357204437256<br />rm: 0.018457174301147<br />
Output for 5.3.29
getcons 0.01454496383667<br />rm: 0.020019054412842<br />
Output for 5.3.28
getcons 0.010235071182251<br />rm: 0.011232852935791<br />
Output for 5.3.27
getcons 0.0094289779663086<br />rm: 0.010977983474731<br />
Output for 5.3.26
getcons 0.0098490715026855<br />rm: 0.0098249912261963<br />
Output for 5.3.25
getcons 0.010345935821533<br />rm: 0.01005482673645<br />
Output for 5.3.24
getcons 0.010372877120972<br />rm: 0.011018991470337<br />
Output for 5.3.23
getcons 0.010272979736328<br />rm: 0.010987997055054<br />
Output for 5.3.22
getcons 0.010133028030396<br />rm: 0.010764122009277<br />
Output for 5.3.21
getcons 0.010295867919922<br />rm: 0.011529922485352<br />
Output for 5.3.20
getcons 0.010802984237671<br />rm: 0.011223077774048<br />
Output for 5.3.19
getcons 0.0098638534545898<br />rm: 0.011652946472168<br />
Output for 5.3.18
getcons 0.017982959747314<br />rm: 0.011069059371948<br />
Output for 5.3.17
getcons 0.010380983352661<br />rm: 0.010844945907593<br />
Output for 5.3.16
getcons 0.010901927947998<br />rm: 0.011626958847046<br />
Output for 5.3.15
getcons 0.010771989822388<br />rm: 0.010918140411377<br />
Output for 5.3.14
getcons 0.010625123977661<br />rm: 0.011392831802368<br />
Output for 5.3.13
getcons 0.0089969635009766<br />rm: 0.010214805603027<br />
Output for 5.3.12
getcons 0.008897066116333<br />rm: 0.01010799407959<br />
Output for 5.3.11
getcons 0.0090038776397705<br />rm: 0.01010799407959<br />
Output for 5.3.10
getcons 0.0096960067749023<br />rm: 0.010702848434448<br />
Output for 5.3.9
getcons 0.0090270042419434<br />rm: 0.011214971542358<br />
Output for 5.3.8
getcons 0.0089719295501709<br />rm: 0.010305166244507<br />
Output for 5.3.7
getcons 0.009727954864502<br />rm: 0.0098419189453125<br />
Output for 5.3.6
getcons 0.0090250968933105<br />rm: 0.0099470615386963<br />
Output for 5.3.5
getcons 0.010049104690552<br />rm: 0.010646104812622<br />
Output for 5.3.4
getcons 0.0085752010345459<br />rm: 0.01111888885498<br />
Output for 5.3.3
getcons 0.0082738399505615<br />rm: 0.0094490051269531<br />
Output for 5.3.2
getcons 0.0097808837890625<br />rm: 0.0099329948425293<br />
Output for 5.3.1
getcons 0.0083019733428955<br />rm: 0.0089058876037598<br />
Output for 5.3.0
getcons 0.0088698863983154<br />rm: 0.010236024856567<br />
Output for 5.2.17
getcons 0.0083138942718506<br />rm: 0.0088100433349609<br />
Output for 5.2.16
getcons 0.0089881420135498<br />rm: 0.0094621181488037<br />
Output for 5.2.15
getcons 0.0088269710540771<br />rm: 0.0095891952514648<br />
Output for 5.2.14
getcons 0.0084781646728516<br />rm: 0.009207010269165<br />
Output for 5.2.13
getcons 0.009303092956543<br />rm: 0.0097489356994629<br />
Output for 5.2.12
getcons 0.0086088180541992<br />rm: 0.010679960250854<br />
Output for 5.2.11
getcons 0.0089139938354492<br />rm: 0.0098519325256348<br />
Output for 5.2.10
getcons 0.0084691047668457<br />rm: 0.010011196136475<br />
Output for 5.2.9
getcons 0.0091090202331543<br />rm: 0.016105175018311<br />
Output for 5.2.8
getcons 0.015766859054565<br />rm: 0.014949083328247<br />
Output for 5.2.7
getcons 0.0089991092681885<br />rm: 0.0099020004272461<br />
Output for 5.2.6
getcons 0.008526086807251<br />rm: 0.0091359615325928<br />
Output for 5.2.5
getcons 0.0090491771697998<br />rm: 0.0092780590057373<br />
Output for 5.2.4
getcons 0.0086197853088379<br />rm: 0.0091500282287598<br />
Output for 5.2.3
getcons 0.0086369514465332<br />rm: 0.0092329978942871<br />
Output for 5.2.2
getcons 0.0086870193481445<br />rm: 0.0091121196746826<br />
Output for 5.2.1
getcons 0.0084431171417236<br />rm: 0.010611057281494<br />
Output for 5.2.0
getcons 0.010991096496582<br />rm: 0.010596036911011<br />
Output for 5.1.6
getcons 0.0084309577941895<br />rm: 0.0092058181762695<br />
Output for 5.1.5
getcons 0.014039039611816<br />rm: 0.0098991394042969<br />
Output for 5.1.4
getcons 0.018980979919434<br />rm: 0.018056154251099<br />
Output for 5.1.3
getcons 0.013475179672241<br />rm: 0.016656875610352<br />
Output for 5.1.2
getcons 0.009617805480957<br />rm: 0.0097439289093018<br />
Output for 5.1.1
getcons 0.0080561637878418<br />rm: 0.0089631080627441<br />
Output for 5.1.0
getcons 0.0077221393585205<br />rm: 0.0087811946868896<br />
Output for 5.0.5
getcons 0.011292934417725<br />rm: 0.0035970211029053<br />
Output for 5.0.4
getcons 0.011461019515991<br />rm: 0.0037848949432373<br />
Output for 5.0.3
getcons 0.010610103607178<br />rm: 0.0039169788360596<br />
Output for 5.0.2
getcons 0.010880947113037<br />rm: 0.003507137298584<br />
Output for 5.0.1
getcons 0.011468172073364<br />rm: 0.0035500526428223<br />
Output for 5.0.0
getcons 0.0097579956054688<br />rm: 0.0040600299835205<br />
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/5ETqZ on line 7
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/5ETqZ on line 7
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/5ETqZ on line 7
Process exited with code 255.