3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait T { private function getId() { return 'trait'; } } class C{ use T; public function get() { return $this->getId(); } } $c = new C; echo $c->getId();
based on T8J1Q
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to private method C::getId() from context '' in /in/OP9vV:22 Stack trace: #0 {main} thrown in /in/OP9vV on line 22
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Fatal error: Call to private method C::getId() from context '' in /in/OP9vV on line 22
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/OP9vV on line 3
Process exited with code 255.