3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $a; public function __construct(){ echo('Very well!'); $this->a = 'X'; } public function e(){ $a = function(){ var_dump($this); echo('OK'); }; $a(); } } $x = new A; $x->e();

preferences:
36.12 ms | 402 KiB | 5 Q