We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f72d77 commit d9fbbbcCopy full SHA for d9fbbbc
Zend/tests/grandparent_prototype.phpt
@@ -0,0 +1,26 @@
1
+--TEST--
2
+Protected visibility test case with a grandparent prototype
3
+--FILE--
4
+<?php
5
+
6
+class A {
7
+ protected function test() {}
8
+}
9
+class B extends A {
10
+ public function test2($x) {
11
+ $x->test(); // Uncaught Error: Call to protected method D::test() from context 'B'
12
+ }
13
14
+class C extends A {
15
16
17
+class D extends C {
18
+ protected function test() {
19
+ echo "Hello World!\n";
20
21
22
+(new B)->test2(new D);
23
24
+?>
25
+--EXPECT--
26
+Hello World!
0 commit comments