3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected $_b = 'protected'; private $_c = 'private'; } $method = function (){ $this = new stdClass; var_dump($this->_b, $this->_c);}; $a = new A; $method = $method->bindTo($a); $method();
Output for 5.3.0 - 5.3.13, 5.4.0 - 5.4.3
Fatal error: Cannot re-assign $this in /in/MBmPl on line 8
Process exited with code 255.

preferences:
147.58 ms | 1395 KiB | 25 Q