<?php class A { protected $foo; private function foo() { $this->foo = 'A-foo'; } public function bar() { $this->foo(); return $this->foo; } } class B extends A { private function foo() { $this->foo = 'B-foo'; } } echo (new B())->bar();
You have javascript disabled. You will not be able to edit any code.