summaryrefslogtreecommitdiff
path: root/Zend/tests/bug21888.phpt
blob: 43b19c1e8b6c202c9837c00ab2214fda9ec97531 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--TEST--
Bug #21888 (protected property and protected method of the same name)
--SKIPIF--
<?php 
	if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); 
?>
--FILE--
<?php
class mom {

  protected $prot = "protected property\n";

  protected function prot() {
    print "protected method\n";
  } 
}

class child extends mom {
  
  public function callMom() {
    $this->prot();
  }
  
  public function viewMom() {
    print $this->prot;
  }
  
}

$c = new child();
$c->callMom();
$c->viewMom();
?>
--EXPECT--
protected method
protected property
--EXPECT--
protected method
protected property