1--TEST-- 2Protected visibility test case with a grandparent prototype 3--FILE-- 4<?php 5 6class A { 7 protected function test() {} 8} 9class B extends A { 10 public function test2($x) { 11 $x->test(); // Uncaught Error: Call to protected method D::test() from scope B 12 } 13} 14class C extends A { 15 protected function test() {} 16} 17class D extends C { 18 protected function test() { 19 echo "Hello World!\n"; 20 } 21} 22(new B)->test2(new D); 23 24?> 25--EXPECT-- 26Hello World! 27