3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public esam = 10; } class B { public mase = 20; } $a = new A; $a->esam = new B; echo $a->esam;
Output for 7.1.0 - 7.3.0alpha1
Parse error: syntax error, unexpected 'esam' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /in/5hVBJ on line 5
Process exited with code 255.
Output for 5.6.30, 7.0.30
Parse error: syntax error, unexpected 'esam' (T_STRING), expecting variable (T_VARIABLE) in /in/5hVBJ on line 5
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught Error: syntax error, unexpected '=', expecting T_VARIABLE in /in/5hVBJ:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught Error: syntax error, unexpected '=', expecting T_VARIABLE in /in/5hVBJ:5 Stack trace: #0 {main}
Process exited with code 255.