3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { function doShit() { echo 'SHIT'; } } ($foo = new Foo)->doShit(); (clone $foo)->doShit();
based on Zf4vP
Output for 7.0.0 - 7.2.6
SHITSHIT
Output for 5.6.0 - 5.6.25
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /in/tgo8a on line 7
Process exited with code 255.