xref: /PHP-7.2/Zend/tests/bug21888.phpt (revision 17ccbeec)
1--TEST--
2Bug #21888 (protected property and protected method of the same name)
3--FILE--
4<?php
5class mom {
6
7  protected $prot = "protected property\n";
8
9  protected function prot() {
10    print "protected method\n";
11  }
12}
13
14class child extends mom {
15
16  public function callMom() {
17    $this->prot();
18  }
19
20  public function viewMom() {
21    print $this->prot;
22  }
23
24}
25
26$c = new child();
27$c->callMom();
28$c->viewMom();
29?>
30--EXPECT--
31protected method
32protected property
33