3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait Home { protected $name = 'Fredrik'; protected function getName() { return $this->name; } } class Say { use Home; } $say = new Say; echo $say->getName();
based on gH3it
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to protected method Say::getName() from context '' in /in/6VRLF:16 Stack trace: #0 {main} thrown in /in/6VRLF on line 16
Process exited with code 255.
Output for 5.4.0 - 5.6.21
Fatal error: Call to protected method Say::getName() from context '' in /in/6VRLF on line 16
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/6VRLF on line 3
Process exited with code 255.