fork(2) download
  1. <?php
  2. ini_set('display_errors', true);
  3.  
  4. class Foo
  5. {
  6. private static $name = 'foo';
  7. public static function getName()
  8. {
  9. return static::$name;
  10. }
  11. }
  12.  
  13. class Bar extends Foo
  14. {
  15. private static $name = 'bar';
  16. }
  17.  
  18. echo Bar::getName();
Runtime error #stdin #stdout #stderr 0.03s 52432KB
stdin
Standard input is empty
stdout
Fatal error: Cannot access private property Bar::$name in /home/sJ2hLV/prog.php on line 10
stderr
PHP Fatal error:  Cannot access private property Bar::$name in /home/sJ2hLV/prog.php on line 10