summaryrefslogtreecommitdiff
path: root/tests/classes/interface_constant_inheritance_002.phpt
diff options
context:
space:
mode:
authorRobin Fernandes <robinf@php.net>2008-03-06 11:02:37 +0000
committerRobin Fernandes <robinf@php.net>2008-03-06 11:02:37 +0000
commitee0f7bc0ac34ea6b96650bb7715517372d2af711 (patch)
tree682fdd268766b246e63f0d98174d2db757d6aafb /tests/classes/interface_constant_inheritance_002.phpt
parent34c89a26010f97bc6f3321160ba82419388c2af8 (diff)
downloadphp-git-ee0f7bc0ac34ea6b96650bb7715517372d2af711.tar.gz
Add new tests for class/object functions and features.
Diffstat (limited to 'tests/classes/interface_constant_inheritance_002.phpt')
-rw-r--r--tests/classes/interface_constant_inheritance_002.phpt17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/classes/interface_constant_inheritance_002.phpt b/tests/classes/interface_constant_inheritance_002.phpt
new file mode 100644
index 0000000000..d5001baa3d
--- /dev/null
+++ b/tests/classes/interface_constant_inheritance_002.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Ensure a class may not shadow a constant inherited from an interface.
+--FILE--
+<?php
+interface I {
+ const FOO = 10;
+}
+
+class C implements I {
+ const FOO = 10;
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+
+Fatal error: Cannot inherit previously-inherited constant FOO from interface I in %s on line 6 \ No newline at end of file