access_modifiers_008.phpt 472 B

123456789101112131415161718192021
  1. --TEST--
  2. Inconsistencies when accessing protected members
  3. --XFAIL--
  4. Discussion: http://marc.info/?l=php-internals&m=120221184420957&w=2
  5. --FILE--
  6. <?php
  7. class A {
  8. static protected function f() {return 'A::f()';}
  9. }
  10. class B1 extends A {
  11. static protected function f() {return 'B1::f()';}
  12. }
  13. class B2 extends A {
  14. static public function test() {echo B1::f();}
  15. }
  16. B2::test();
  17. ?>
  18. --EXPECTF--
  19. Fatal error: Call to protected method B1::f() from scope B2 in %s on line %d