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()); ?>
Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.15
Parse error: syntax error, unexpected '(' in /in/ugPM5 on line 16
Process exited with code 255.

preferences:
159.92 ms | 1395 KiB | 22 Q