constants_visibility_error_004.phpt 319 B

1234567891011121314
  1. --TEST--
  2. A redeclared class constant must have the same or higher visibility
  3. --FILE--
  4. <?php
  5. class A {
  6. protected const protectedConst = 0;
  7. }
  8. class B extends A {
  9. private const protectedConst = 1;
  10. }
  11. --EXPECTF--
  12. Fatal error: Access level to B::protectedConst must be protected (as in class A) or weaker in %s on line 9