3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { private $a = "Hello"; public function saySomething(){ echo $this->a; } } $func = function($a) { $this->a = $a; }; $obj = new A(); $func = Closure::bind($func, $obj, $obj); $func("Worked"); $obj->saySomething();
based on 72T5p
Output for 5.5.0 - 7.3.0rc3
Worked