Annotation of embedaddon/php/tests/classes/private_006b.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: ZE2 A private method can be overwritten in a second derived class
! 3: --SKIPIF--
! 4: <?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: class first {
! 9: private function show() {
! 10: echo "Call show()\n";
! 11: }
! 12:
! 13: public function do_show() {
! 14: $this->show();
! 15: }
! 16: }
! 17:
! 18: $t1 = new first();
! 19: $t1->do_show();
! 20:
! 21: class second extends first {
! 22: }
! 23:
! 24: //$t2 = new second();
! 25: //$t2->do_show();
! 26:
! 27: class third extends second {
! 28: private function show() {
! 29: echo "Call show()\n";
! 30: }
! 31: }
! 32:
! 33: $t3 = new third();
! 34: $t3->do_show();
! 35:
! 36: echo "Done\n";
! 37: ?>
! 38: --EXPECTF--
! 39: Call show()
! 40: Call show()
! 41: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>