File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug21888.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:52 2012 UTC (13 years, 1 month ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

    1: --TEST--
    2: Bug #21888 (protected property and protected method of the same name)
    3: --SKIPIF--
    4: <?php 
    5: 	if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); 
    6: ?>
    7: --FILE--
    8: <?php
    9: class mom {
   10: 
   11:   protected $prot = "protected property\n";
   12: 
   13:   protected function prot() {
   14:     print "protected method\n";
   15:   } 
   16: }
   17: 
   18: class child extends mom {
   19:   
   20:   public function callMom() {
   21:     $this->prot();
   22:   }
   23:   
   24:   public function viewMom() {
   25:     print $this->prot;
   26:   }
   27:   
   28: }
   29: 
   30: $c = new child();
   31: $c->callMom();
   32: $c->viewMom();
   33: ?>
   34: --EXPECT--
   35: protected method
   36: protected property

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>