diff options
Diffstat (limited to 'tests/classes/constants_visibility_error_003.phpt')
-rw-r--r-- | tests/classes/constants_visibility_error_003.phpt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/classes/constants_visibility_error_003.phpt b/tests/classes/constants_visibility_error_003.phpt new file mode 100644 index 0000000000..c385bbd300 --- /dev/null +++ b/tests/classes/constants_visibility_error_003.phpt @@ -0,0 +1,16 @@ +--TEST-- +A redeclared class constant must have the same or higher visibility +--FILE-- +<?php + +class A { + public const publicConst = 0; +} + +class B extends A { + protected const publicConst = 1; +} + + +--EXPECTF-- +Fatal error: Access level to B::publicConst must be public (as in class A) in %s on line 9 |