3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { protected $bar; public function init($callable) { $callable($this, $this->bar); } public function setBar($bar) { $this->bar = $bar; } } $a = new A(); $callable1 = function($obj, &$bar) { $bar = 'foo'; }; $callable2 = function($obj, &$bar) { $obj->setBar('foo'); }; foreach (array($callable1, $callable2) as $cb) { $start = microtime(true); for ($i = 0; $i < 100000; $i += 1) { $a->init($cb); } var_dump(microtime(true) - $start); }
Output for 7.1.0
float(0.012871026992798) float(0.016239881515503)
Output for 7.0.14
float(-0.0032260417938232) float(-0.018763065338135)
Output for 7.0.12
float(0.0074539184570312) float(0.011560916900635)
Output for 7.0.6
float(0.012431144714355) float(0.015675067901611)
Output for 7.0.5
float(0.0084531307220459) float(0.011401891708374)
Output for 7.0.4
float(0.0079789161682129) float(0.010926008224487)
Output for 7.0.3
float(0.011504888534546) float(0.016222953796387)
Output for 7.0.2
float(0.0089261531829834) float(0.011007070541382)
Output for 7.0.1
float(0.0084438323974609) float(0.010922908782959)
Output for 7.0.0
float(0.008051872253418) float(0.011442184448242)
Output for hhvm-3.12.0
float(0.066667079925537) float(0.0589439868927)
Output for hhvm-3.10.0
float(0.042865991592407) float(0.05427885055542)
Output for 5.6.28
float(0.040623903274536) float(0.05161714553833)
Output for 5.6.21
float(0.031164169311523) float(0.038771867752075)
Output for 5.6.20
float(0.030646085739136) float(0.038066148757935)
Output for 5.6.19
float(0.03325891494751) float(0.036821126937866)
Output for 5.6.18
float(0.031223058700562) float(0.038916110992432)
Output for 5.6.17
float(0.03145694732666) float(0.039553165435791)
Output for 5.6.16
float(0.030408143997192) float(0.034713983535767)
Output for 5.6.15
float(0.034256935119629) float(0.036491870880127)
Output for 5.6.14
float(0.033896923065186) float(0.041199922561646)
Output for 5.6.13
float(0.036186933517456) float(0.042571067810059)
Output for 5.6.12
float(0.03069806098938) float(0.03785514831543)
Output for 5.6.11
float(0.033628225326538) float(0.039973020553589)
Output for 5.6.10
float(0.032757997512817) float(0.038079977035522)
Output for 5.6.9
float(0.0243821144104) float(0.033416032791138)
Output for 5.6.8
float(0.024649143218994) float(0.034672975540161)
Output for 5.6.7
float(0.033437013626099) float(0.045917987823486)
Output for 5.5.35
float(0.029132843017578) float(0.036655902862549)
Output for 5.5.34
float(0.031848192214966) float(0.039171934127808)
Output for 5.5.33
float(0.03405499458313) float(0.042859077453613)
Output for 5.5.32
float(0.025388956069946) float(0.031641960144043)
Output for 5.5.31
float(0.023107051849365) float(0.031713008880615)
Output for 5.5.30
float(0.023705959320068) float(0.032489061355591)
Output for 5.5.29
float(0.033349990844727) float(0.040616989135742)
Output for 5.5.28
float(0.030515193939209) float(0.038135051727295)
Output for 5.5.27
float(0.033722877502441) float(0.039623022079468)
Output for 5.5.26
float(0.029711961746216) float(0.037349939346313)
Output for 5.5.25
float(0.02893590927124) float(0.031855821609497)
Output for 5.5.24
float(0.02279806137085) float(0.031558036804199)
Output for 5.4.45
float(0.031672954559326) float(0.039448976516724)
Output for 5.4.44
float(0.032850980758667) float(0.040591955184937)
Output for 5.4.43
float(0.021723985671997) float(0.031046867370605)
Output for 5.4.42
float(0.028608083724976) float(0.034235954284668)
Output for 5.4.41
float(0.023555994033813) float(0.031162023544312)
Output for 5.4.40
float(0.033182859420776) float(0.037515163421631)
Output for 5.4.39
float(0.031009197235107) float(0.036397933959961)
Output for 5.4.38
float(0.032334089279175) float(0.040220975875854)
Output for 5.4.37
float(0.023468971252441) float(0.032193899154663)
Output for 5.4.36
float(0.032001972198486) float(0.058681964874268)
Output for 5.4.35
float(0.021776914596558) float(0.031377792358398)
Output for 5.4.34
float(0.033340930938721) float(0.040585041046143)
Output for 5.4.32
float(0.025468111038208) float(0.033731937408447)
Output for 5.4.31
float(0.033578157424927) float(0.040957927703857)
Output for 5.4.30
float(0.024101972579956) float(0.032557010650635)
Output for 5.4.29
float(0.022732019424438) float(0.030589818954468)
Output for 5.4.28
float(0.036809921264648) float(0.041276931762695)
Output for 5.4.27
float(0.032044887542725) float(0.039029836654663)
Output for 5.4.26
float(0.029386043548584) float(0.038725852966309)
Output for 5.4.25
float(0.032290935516357) float(0.04102087020874)
Output for 5.4.24
float(0.031107902526855) float(0.039278030395508)
Output for 5.4.23
float(0.025774002075195) float(0.03107213973999)
Output for 5.4.22
float(0.021079063415527) float(0.030483961105347)
Output for 5.4.21
float(0.032650947570801) float(0.042281866073608)
Output for 5.4.20
float(0.02556586265564) float(0.031209945678711)
Output for 5.4.19
float(0.032765865325928) float(0.040113925933838)
Output for 5.4.18
float(0.021569967269897) float(0.030209064483643)
Output for 5.4.17
float(0.026049137115479) float(0.0330970287323)
Output for 5.4.16
float(0.032226085662842) float(0.040618896484375)
Output for 5.4.15
float(0.03410005569458) float(0.040105819702148)
Output for 5.4.14
float(0.028140068054199) float(0.036542892456055)
Output for 5.4.13
float(0.026255130767822) float(0.036263942718506)
Output for 5.4.12
float(0.034766912460327) float(0.042218923568726)
Output for 5.4.11
float(0.02363395690918) float(0.031430959701538)
Output for 5.4.10
float(0.022836923599243) float(0.036994934082031)
Output for 5.4.9
float(0.022005081176758) float(0.031996011734009)
Output for 5.4.8
float(0.036504030227661) float(0.039720058441162)
Output for 5.4.7
float(0.021853923797607) float(0.033360958099365)
Output for 5.4.6
float(0.022371053695679) float(0.031439065933228)
Output for 5.4.5
float(0.021065950393677) float(0.029765129089355)
Output for 5.4.4
float(0.024780035018921) float(0.034470081329346)
Output for 5.4.3
float(0.023139953613281) float(0.031780004501343)
Output for 5.4.2
float(0.030378103256226) float(0.04418683052063)
Output for 5.4.1
float(0.028682947158813) float(0.041577100753784)
Output for 5.4.0
float(0.031523942947388) float(0.043642997741699)
Output for 5.3.29
float(0.044874906539917) float(0.063387155532837)
Output for 5.3.28
float(0.039838075637817) float(0.050307035446167)
Output for 5.3.27
float(0.044573068618774) float(0.056107997894287)
Output for 5.3.26
float(0.04623818397522) float(0.058820009231567)
Output for 5.3.25
float(0.039463996887207) float(0.052305936813354)
Output for 5.3.24
float(0.044780969619751) float(0.056927919387817)
Output for 5.3.23
float(0.038558006286621) float(0.05417799949646)
Output for 5.3.22
float(0.040703058242798) float(0.048741817474365)
Output for 5.3.21
float(0.031136035919189) float(0.048723936080933)
Output for 5.3.20
float(0.046019077301025) float(0.054171085357666)
Output for 5.3.19
float(0.04554009437561) float(0.054818153381348)
Output for 5.3.18
float(0.032047033309937) float(0.046679019927979)
Output for 5.3.17
float(0.031326055526733) float(0.048895835876465)
Output for 5.3.16
float(0.029997110366821) float(0.046457052230835)
Output for 5.3.15
float(0.041975975036621) float(0.060967922210693)
Output for 5.3.14
float(0.031983137130737) float(0.050104141235352)
Output for 5.3.13
float(0.033208847045898) float(0.055341005325317)
Output for 5.3.12
float(0.031121969223022) float(0.048064947128296)
Output for 5.3.11
float(0.040887117385864) float(0.060837984085083)
Output for 5.3.10
float(0.031825065612793) float(0.048631191253662)
Output for 5.3.9
float(0.031338930130005) float(0.048389196395874)
Output for 5.3.8
float(0.041521072387695) float(0.062993049621582)
Output for 5.3.7
float(0.029922962188721) float(0.046694040298462)
Output for 5.3.6
float(0.045590162277222) float(0.070196151733398)
Output for 5.3.5
float(0.030232906341553) float(0.047225952148438)
Output for 5.3.4
float(0.030333995819092) float(0.046993970870972)
Output for 5.3.3
float(0.030969858169556) float(0.04771089553833)
Output for 5.3.2
float(0.029664993286133) float(0.046066999435425)
Output for 5.3.1
float(0.031031847000122) float(0.048074960708618)
Output for 5.3.0
float(0.042831182479858) float(0.064462184906006)
Output for 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/SWSNp on line 18
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION in /in/SWSNp on line 18
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/SWSNp on line 5
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/SWSNp on line 5
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/SWSNp on line 5
Process exited with code 255.