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; }; $a = $a->bindTo($a,"A"); $a();
based on qobhP
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Closure object cannot have properties in /in/BGnQ6:8 Stack trace: #0 /in/BGnQ6(14): A->{closure}() #1 {main} thrown in /in/BGnQ6 on line 8
Process exited with code 255.
Output for 5.4.1 - 5.6.28
Catchable fatal error: Closure object cannot have properties in /in/BGnQ6 on line 8
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Fatal error: Call to undefined method Closure::bindTo() in /in/BGnQ6 on line 13
Process exited with code 255.