3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class ParentClass { public function publicGetter() { return 'pubic getter'; } } class ChildClass extends ParentClass { protected function publicGetter() { return 'protected getter'; } } $foo = new ChildClass(); echo $foo->publicGetter();
Output for 5.6.38 - 7.2.11
Fatal error: Access level to ChildClass::publicGetter() must be public (as in class ParentClass) in /in/g7et5 on line 13
Process exited with code 255.