3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public function bar() { echo __METHOD__ . "\n"; return (object); } public function test() { return $this; } } $f = new foo(); echo $f->bar()->{'foo::test'}; echo $f->test()->title;
Output for 7.0.0 - 7.0.31, 7.1.0 - 7.1.21, 7.2.0 - 7.2.9
Parse error: syntax error, unexpected ';' in /in/IcU4A on line 10
Process exited with code 255.

preferences:
186.58 ms | 1395 KiB | 71 Q