diff options
author | Marcus Boerger <helly@php.net> | 2003-06-01 18:35:29 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2003-06-01 18:35:29 +0000 |
commit | c3dd93fb4acd6ec42ae850228ddd7dc7e47535cc (patch) | |
tree | 7ea05da58e539de2813ad5941d413f9f7ad7cbb0 /Zend/tests/bug22725.phpt | |
parent | 070803a482e3da4c1b1cf86bbe056373b37556c0 (diff) | |
download | php-git-c3dd93fb4acd6ec42ae850228ddd7dc7e47535cc.tar.gz |
Add some ZE2 bug tests
Diffstat (limited to 'Zend/tests/bug22725.phpt')
-rwxr-xr-x | Zend/tests/bug22725.phpt | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Zend/tests/bug22725.phpt b/Zend/tests/bug22725.phpt new file mode 100755 index 0000000000..aecb0ce486 --- /dev/null +++ b/Zend/tests/bug22725.phpt @@ -0,0 +1,31 @@ +--TEST-- +A derived class can call a parent's protected method that calls a private method +--SKIPIF-- +<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> +--FILE-- +<?php +class Foo { + private function aPrivateMethod() { + echo "Foo::aPrivateMethod() called.\n"; + } + + protected function aProtectedMethod() { + echo "Foo::aProtectedMethod() called.\n"; + $this->aPrivateMethod(); + } +} + +class Bar extends Foo { + public function aPublicMethod() { + echo "Bar::aPublicMethod() called.\n"; + $this->aProtectedMethod(); + } +} + +$o = new Bar; +$o->aPublicMethod(); +?> +--EXPECT-- +Bar::aPublicMethod() called. +Foo::aProtectedMethod() called. +Foo::aPrivateMethod() called. |