summaryrefslogtreecommitdiff
path: root/tests/classes/visibility_003b.phpt
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-02-05 23:07:24 +0000
committerMarcus Boerger <helly@php.net>2003-02-05 23:07:24 +0000
commit984cde31238e45dfc28ba21553802d297e3eb121 (patch)
treea94c462f7da726813f35a71edb301d0c2ccc5919 /tests/classes/visibility_003b.phpt
parentedde957038c1dc1514eda868326fd7b70e492389 (diff)
downloadphp-git-984cde31238e45dfc28ba21553802d297e3eb121.tar.gz
Add PPP method tests
Diffstat (limited to 'tests/classes/visibility_003b.phpt')
-rw-r--r--tests/classes/visibility_003b.phpt33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/classes/visibility_003b.phpt b/tests/classes/visibility_003b.phpt
new file mode 100644
index 0000000000..f2de2d2ff6
--- /dev/null
+++ b/tests/classes/visibility_003b.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 {
+ private function f3() {}
+}
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Fatal error: Access level to fail::f3() must be protected (as in class same) or weaker in %s on line %d