3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { private $c = "Secret"; } $a = function() { echo $this->c."\n"; $this->c = "new Secret"; echo $this->c; }; $b = $a->bind($a,"\\A"); $b();
based on 6KBTB
Output for 7.0.0 - 7.2.0
Warning: Closure::bind() expects parameter 2 to be object, string given in /in/V0MpW on line 13 Fatal error: Uncaught Error: Function name must be a string in /in/V0MpW:14 Stack trace: #0 {main} thrown in /in/V0MpW on line 14
Process exited with code 255.
Output for 5.4.1 - 5.6.21
Warning: Closure::bind() expects parameter 2 to be object, string given in /in/V0MpW on line 13 Fatal error: Function name must be a string in /in/V0MpW on line 14
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Fatal error: Call to undefined method Closure::bind() in /in/V0MpW on line 13
Process exited with code 255.