3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test2 { } class test3 { } class test { private $title ='test2'; function aaa() { return new $this->title(); } function bbb() { $title =$this->title(); return (new $this->title())(); } function title() { return 'test3'; } } $t = new test; var_dump($t->aaa()); var_dump($t->bbb()); ?>

preferences:
53.74 ms | 402 KiB | 5 Q