3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class C { public function func($str) { echo $str; } } $c = new C(); $sq = 'hoge'; $dq = "hoge"; $fn = 'func' $c->func('beta'); $c->func($sq); $c->func($dq); $c->$fn('beta'); $c->$fn($sq); $c->$fn($dq);
Output for 7.1.7
Parse error: syntax error, unexpected '$c' (T_VARIABLE) in /in/ioITZ on line 16
Process exited with code 255.