} $e4 = new F4(); $e4->test(); // Outputs 'D4::foo false' class D5 { private function foo() { echo "D5::foo " . (isset($this) ? "true\n" : "false\n"); } public function test() { F5::foo(); } } class E5 extends D5 { } class X5 extends D5 { private function foo() { echo "X5::foo\n"; } } class F5 extends X5 { } $e5 = new E5(); $e5->test(); // Fatals
function main5() { $e5 = new E5(); $e5->test(); // Fatals }