3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Qwe { public ${''} = 20; public function __construct(){ echo $this->{''}.PHP_EOL; } } ${''}=10; echo ${''}.PHP_EOL; // 10 echo ${null}.PHP_EOL; // 10 $b = new Qwe;
Output for 7.1.0 - 7.2.9
Parse error: syntax error, unexpected '$', expecting function (T_FUNCTION) or const (T_CONST) in /in/AHJkJ on line 5
Process exited with code 255.
Output for 5.6.30, 7.0.0 - 7.0.31
Parse error: syntax error, unexpected '$', expecting variable (T_VARIABLE) in /in/AHJkJ on line 5
Process exited with code 255.
Output for hhvm-3.20.2, hhvm-3.22.0
Fatal error: Uncaught Error: syntax error, unexpected '$', expecting T_VARIABLE in /in/AHJkJ:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.15.4 - 3.19.2, hhvm-3.21.0 - 3.21.3
Fatal error: Uncaught Error: syntax error, unexpected '$', expecting T_VARIABLE in /in/AHJkJ:5 Stack trace: #0 {main}
Process exited with code 255.