3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { protected $_b = 'protected'; private $_c = 'private'; } $method = function (){ var_dump($this->_b, $this->_c);}; $a = new A; $a->newMethod = $method->bindTo($a, 'A'); {$a->newMethod}(); var_dump($a);
Output for 5.3.0 - 5.4.3
Parse error: syntax error, unexpected '}' in /in/fe1co on line 11
Process exited with code 255.