diff options
author | Marcus Boerger <helly@php.net> | 2003-07-03 10:05:01 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2003-07-03 10:05:01 +0000 |
commit | 2044fbf59ee73eb65cf067d8926806e3a06b145d (patch) | |
tree | 837f3032d556f8c2120c25ae101c03eca0441b23 | |
parent | 3f0d60f7497bbf8e60cad784be93fb5d10dc42d3 (diff) | |
download | php-git-2044fbf59ee73eb65cf067d8926806e3a06b145d.tar.gz |
Check private redeclare behavior
-rwxr-xr-x | tests/classes/private_redeclare.phpt | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/classes/private_redeclare.phpt b/tests/classes/private_redeclare.phpt new file mode 100755 index 0000000000..e3061f1136 --- /dev/null +++ b/tests/classes/private_redeclare.phpt @@ -0,0 +1,38 @@ +--TEST-- +ZE2 A derived class does not know anything about inherited private methods +--FILE-- +<?php +class base { + private function show() { + echo "base\n"; + } + function test() { + $this->show(); + } +} + +$t = new base(); +$t->test(); + +class derived extends base { + function show() { + echo "derived\n"; + } + function test() { + echo "test\n"; + $this->show(); + parent::test(); + parent::show(); + } +} + +$t = new derived(); +$t->test(); +?> +--EXPECTF-- +base +test +derived +base + +Fatal error: Call to private method base::show() from context 'derived' in %s on line %d |