3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class C { 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);
based on IjLYV
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.7
Parse error: syntax error, unexpected '$C' (T_VARIABLE) in /in/tmCUJ on line 16
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: syntax error, unexpected T_VARIABLE in /in/tmCUJ:16 Stack trace: #0 {main}
Process exited with code 255.