static_properties_003_error1.phpt 439 B

1234567891011121314151617181920
  1. --TEST--
  2. Attempting to access static properties using instance property syntax
  3. --FILE--
  4. <?php
  5. class C {
  6. protected static $y = 'C::$y';
  7. }
  8. $c = new C;
  9. echo "\n--> Access non-visible static prop like instance prop:\n";
  10. unset($c->y);
  11. ?>
  12. ==Done==
  13. --EXPECTF--
  14. --> Access non-visible static prop like instance prop:
  15. Fatal error: Uncaught Error: Cannot access protected property C::$y in %s:8
  16. Stack trace:
  17. #0 {main}
  18. thrown in %s on line 8