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'); }; ($c = $x->a)();

preferences:
44.04 ms | 402 KiB | 5 Q