3v4l.org

run code in 300+ PHP versions simultaneously
<?php $o = new class { public $val = 'I do get seen!'; public function fun() { // use `this` to reference the current object we are in! return $this->val; } }; var_dump($o->fun());

preferences:
29.92 ms | 404 KiB | 5 Q