3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { public $bar; public function init($callable) { $callable($this, $this->bar); } public function setBar($bar) { $this->bar = $bar; } } $a = new A(); $callable1 = function($obj, &$bar) { $obj->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.013015985488892) float(0.015558004379272)
Output for 7.0.14
float(-0.013241052627563) float(-0.019033908843994)
Output for 7.0.12
float(0.01429009437561) float(0.020203113555908)
Output for 7.0.6
float(0.01211404800415) float(0.014811038970947)
Output for 7.0.5
float(0.0084829330444336) float(0.01106595993042)
Output for 7.0.4
float(0.0098199844360352) float(0.01242208480835)
Output for 7.0.3
float(0.011493921279907) float(0.014328956604004)
Output for 7.0.2
float(0.010331153869629) float(0.012796878814697)
Output for 7.0.1
float(0.01318097114563) float(0.015887975692749)
Output for 7.0.0
float(0.012542963027954) float(0.015610218048096)
Output for 5.6.28
float(0.045130968093872) float(0.052352905273438)
Output for 5.6.21
float(0.034785032272339) float(0.03242301940918)
Output for 5.6.20
float(0.027583837509155) float(0.03254508972168)
Output for 5.6.19
float(0.032530069351196) float(0.03669285774231)
Output for 5.6.18
float(0.024443864822388) float(0.031396865844727)
Output for 5.6.17
float(0.030396938323975) float(0.034349918365479)
Output for 5.6.16
float(0.046451807022095) float(0.039791107177734)
Output for 5.6.15
float(0.038264989852905) float(0.040370941162109)
Output for 5.6.14
float(0.036026000976562) float(0.038975954055786)
Output for 5.6.13
float(0.036673069000244) float(0.039566993713379)
Output for 5.6.12
float(0.025420904159546) float(0.031986951828003)
Output for 5.6.11
float(0.035200119018555) float(0.03569507598877)
Output for 5.6.10
float(0.033025979995728) float(0.037186145782471)
Output for 5.6.9
float(0.025721788406372) float(0.032756090164185)
Output for 5.6.8
float(0.038641214370728) float(0.03642201423645)
Output for 5.5.35
float(0.038079023361206) float(0.047518968582153)
Output for 5.5.34
float(0.034118175506592) float(0.031513929367065)
Output for 5.5.33
float(0.02543306350708) float(0.031733989715576)
Output for 5.5.32
float(0.02578592300415) float(0.03154182434082)
Output for 5.5.31
float(0.031637907028198) float(0.036298036575317)
Output for 5.5.30
float(0.025372982025146) float(0.031590938568115)
Output for 5.5.29
float(0.033900022506714) float(0.037029027938843)
Output for 5.5.28
float(0.036870002746582) float(0.039185047149658)
Output for 5.5.27
float(0.030715942382812) float(0.034106016159058)
Output for 5.5.26
float(0.025295972824097) float(0.034172058105469)
Output for 5.5.25
float(0.026983022689819) float(0.031595945358276)
Output for 5.5.24
float(0.021188020706177) float(0.02695894241333)
Output for 5.4.45
float(0.03658390045166) float(0.039217948913574)
Output for 5.4.44
float(0.037899971008301) float(0.046518087387085)
Output for 5.4.43
float(0.036394834518433) float(0.039039134979248)
Output for 5.4.42
float(0.035969018936157) float(0.034330129623413)
Output for 5.4.41
float(0.038028955459595) float(0.040821075439453)
Output for 5.4.40
float(0.035447120666504) float(0.034154891967773)
Output for 5.4.39
float(0.03676700592041) float(0.034589052200317)
Output for 5.4.38
float(0.038204908370972) float(0.038923025131226)
Output for 5.4.37
float(0.032631874084473) float(0.038011074066162)
Output for 5.4.36
float(0.037073135375977) float(0.039376974105835)
Output for 5.4.35
float(0.024817943572998) float(0.031304121017456)
Output for 5.4.34
float(0.040199995040894) float(0.045919895172119)
Output for 5.4.32
float(0.02472710609436) float(0.031254053115845)
Output for 5.4.31
float(0.030030965805054) float(0.037978887557983)
Output for 5.4.30
float(0.024531126022339) float(0.030515909194946)
Output for 5.4.29
float(0.024123907089233) float(0.029670000076294)
Output for 5.4.28
float(0.024139881134033) float(0.029720067977905)
Output for 5.4.27
float(0.027358055114746) float(0.029140949249268)
Output for 5.4.26
float(0.027832984924316) float(0.032315015792847)
Output for 5.4.25
float(0.024542093276978) float(0.03036093711853)
Output for 5.4.24
float(0.029267072677612) float(0.037686824798584)
Output for 5.4.23
float(0.023929119110107) float(0.030077934265137)
Output for 5.4.22
float(0.024175882339478) float(0.029808044433594)
Output for 5.4.21
float(0.024665832519531) float(0.03031587600708)
Output for 5.4.20
float(0.024554014205933) float(0.030397891998291)
Output for 5.4.19
float(0.043145895004272) float(0.043312072753906)
Output for 5.4.18
float(0.035696029663086) float(0.038203954696655)
Output for 5.4.17
float(0.038435935974121) float(0.04107403755188)
Output for 5.4.16
float(0.035457849502563) float(0.038254976272583)
Output for 5.4.15
float(0.036518812179565) float(0.038780927658081)
Output for 5.4.14
float(0.037955045700073) float(0.040521860122681)
Output for 5.4.13
float(0.032221078872681) float(0.036313772201538)
Output for 5.4.12
float(0.039010047912598) float(0.04171895980835)
Output for 5.4.11
float(0.029145956039429) float(0.035969972610474)
Output for 5.4.10
float(0.024507999420166) float(0.03059196472168)
Output for 5.4.9
float(0.038776874542236) float(0.040125131607056)
Output for 5.4.8
float(0.03710412979126) float(0.046463012695312)
Output for 5.4.7
float(0.036834955215454) float(0.035841941833496)
Output for 5.4.6
float(0.036264181137085) float(0.035959959030151)
Output for 5.4.5
float(0.032380104064941) float(0.036580085754395)
Output for 5.4.4
float(0.037358045578003) float(0.039383888244629)
Output for 5.4.3
float(0.036847114562988) float(0.040908098220825)
Output for 5.4.2
float(0.036740064620972) float(0.047492980957031)
Output for 5.4.1
float(0.038069009780884) float(0.039533138275146)
Output for 5.4.0
float(0.025588035583496) float(0.03150200843811)
Output for 5.3.29
float(0.036612987518311) float(0.046262979507446)
Output for 5.3.28
float(0.040311098098755) float(0.045923948287964)
Output for 5.3.27
float(0.051795959472656) float(0.054380893707275)
Output for 5.3.26
float(0.05500602722168) float(0.056331872940063)
Output for 5.3.25
float(0.052227020263672) float(0.054512977600098)
Output for 5.3.24
float(0.04827094078064) float(0.049474954605103)
Output for 5.3.23
float(0.055050849914551) float(0.056267023086548)
Output for 5.3.22
float(0.044780015945435) float(0.050794124603271)
Output for 5.3.21
float(0.053094148635864) float(0.055175065994263)
Output for 5.3.20
float(0.050864934921265) float(0.052706956863403)
Output for 5.3.19
float(0.044640779495239) float(0.047730922698975)
Output for 5.3.18
float(0.053463935852051) float(0.052806854248047)
Output for 5.3.17
float(0.047960996627808) float(0.05105185508728)
Output for 5.3.16
float(0.048075914382935) float(0.048150062561035)
Output for 5.3.15
float(0.050089120864868) float(0.052917003631592)
Output for 5.3.14
float(0.05460000038147) float(0.055585861206055)
Output for 5.3.13
float(0.046832084655762) float(0.050874948501587)
Output for 5.3.12
float(0.054214000701904) float(0.055927991867065)
Output for 5.3.11
float(0.039003849029541) float(0.047683954238892)
Output for 5.3.10
float(0.051851034164429) float(0.053130149841309)
Output for 5.3.9
float(0.047163009643555) float(0.050139904022217)
Output for 5.3.8
float(0.043808937072754) float(0.048771858215332)
Output for 5.3.7
float(0.04169487953186) float(0.047891139984131)
Output for 5.3.6
float(0.051187038421631) float(0.051531076431274)
Output for 5.3.5
float(0.037813901901245) float(0.047691106796265)
Output for 5.3.4
float(0.056912899017334) float(0.056740045547485)
Output for 5.3.3
float(0.037828922271729) float(0.048092842102051)
Output for 5.3.2
float(0.056392192840576) float(0.071677923202515)
Output for 5.3.1
float(0.052098035812378) float(0.052479982376099)
Output for 5.3.0
float(0.042479038238525) float(0.048280954360962)
Output for 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/eTrY8 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/eTrY8 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/eTrY8 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/eTrY8 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/eTrY8 on line 5
Process exited with code 255.