3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $a; public function __construct(){ echo('Very well!'); $this->a = 'X'; } } $x = new A; $x->a = function(){ var_dump($this); echo('OK'); }; {$x->a}();
Output for 5.3.0 - 5.3.20, 5.4.0 - 5.4.10
Parse error: syntax error, unexpected '}' in /in/psUI8 on line 19
Process exited with code 255.

preferences:
171 ms | 1387 KiB | 39 Q