diff options
author | Marcus Boerger <helly@php.net> | 2003-02-05 23:07:24 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2003-02-05 23:07:24 +0000 |
commit | 984cde31238e45dfc28ba21553802d297e3eb121 (patch) | |
tree | a94c462f7da726813f35a71edb301d0c2ccc5919 /tests/classes/visibility_002a.phpt | |
parent | edde957038c1dc1514eda868326fd7b70e492389 (diff) | |
download | php-git-984cde31238e45dfc28ba21553802d297e3eb121.tar.gz |
Add PPP method tests
Diffstat (limited to 'tests/classes/visibility_002a.phpt')
-rw-r--r-- | tests/classes/visibility_002a.phpt | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/classes/visibility_002a.phpt b/tests/classes/visibility_002a.phpt new file mode 100644 index 0000000000..9fed6225c8 --- /dev/null +++ b/tests/classes/visibility_002a.phpt @@ -0,0 +1,33 @@ +--TEST-- +A redeclared method must have the same or higher visibility +--SKIPIF-- +<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> +--FILE-- +<?php + +class father { + function f0() {} + function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} +} + +class same extends father { + + // overload fn with same visibility + function f0() {} + public function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} +} + +class fail extends same { + protected function f2() {} +} + +echo "Done\n"; // shouldn't be displayed +?> +--EXPECTF-- +Fatal error: Access level to fail::f2() must be public (as in class same) in %s on line %d |