summaryrefslogtreecommitdiff
path: root/tests/classes/visibility_002a.phpt
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:34:21 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:34:21 -0400
commit0e920280a2e04b110827bb766b9f29e3d581c4ee (patch)
tree8f2125f3d00fe3089e3b94adb06f04479ee15f2a /tests/classes/visibility_002a.phpt
downloadphp-0e920280a2e04b110827bb766b9f29e3d581c4ee.tar.gz
Imported Upstream version 5.0.4upstream/5.0.4
Diffstat (limited to 'tests/classes/visibility_002a.phpt')
-rw-r--r--tests/classes/visibility_002a.phpt33
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 000000000..6c88d204d
--- /dev/null
+++ b/tests/classes/visibility_002a.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 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