In is quite surprising but the following code is valid in PHP ~~~php class ParentClass { public function test() { $a = new ChildClass(); $a->onChild(); } } class ChildClass extends ParentClass { protected function onChild() { } } (new ParentClass)->test(); ~~~