3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $a = 'public'; protected $_b = 'protected'; private $_c = 'private'; } $method = function (){ $GLOBALS['x'] =& $this; $GLOBALS['x'] = new stdClass; var_dump($this, $this->a);}; $a = new A; $method = $method->bindTo($a); $method(); var_dump($this);

preferences:
56.45 ms | 402 KiB | 5 Q