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