3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait T { public function x() { print "x"; } private function y() { print "y"; } } class C { use T { x as private; y as public; }; } $c = new C(); $c->x(); $c->y();
based on dgqdl
Output for 7.1.0 - 7.1.6
Parse error: syntax error, unexpected ';', expecting function (T_FUNCTION) or const (T_CONST) in /in/lVV65 on line 12
Process exited with code 255.
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.0.20
Parse error: syntax error, unexpected ';', expecting function (T_FUNCTION) in /in/lVV65 on line 12
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: syntax error, unexpected ';', expecting T_FUNCTION in /in/lVV65:12 Stack trace: #0 {main}
Process exited with code 255.