Annotation of embedaddon/php/Zend/tests/bug38772.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #38772 (inconsistent overriding of methods in different visibility contexts)
! 3: --FILE--
! 4: <?php
! 5: class A {
! 6:
! 7: public function __construct() {
! 8: $this -> foo();
! 9: }
! 10:
! 11: private function foo() {
! 12: echo __METHOD__ . "\r\n";
! 13: }
! 14: }
! 15:
! 16: class B extends A {
! 17: public function foo() {
! 18: echo __METHOD__ . "\r\n";
! 19: }
! 20: }
! 21:
! 22: class C extends A {
! 23: protected function foo() {
! 24: echo __METHOD__ . "\r\n";
! 25: }
! 26: }
! 27:
! 28: class D extends A {
! 29: private function foo() {
! 30: echo __METHOD__ . "\r\n";
! 31: }
! 32: }
! 33:
! 34: $a = new A();
! 35: $b = new B();
! 36: $c = new C();
! 37: $d = new D();
! 38: --EXPECT--
! 39: A::foo
! 40: A::foo
! 41: A::foo
! 42: A::foo
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>