fork download
  1. <?php
  2.  
  3. abstract class Animal {
  4. private $x;
  5. private $y;
  6. private $icon;
  7.  
  8. public function __construct($x, $y, $icon) {
  9. $this->x = $x;
  10. $this->y = $y;
  11. $this->icon = $icon;
  12. }
  13.  
  14. abstract public function move();
  15.  
  16. }
  17.  
  18. class Mouse extends Animal {
  19.  
  20. public function move() {
  21. echo "1";
  22. }
  23.  
  24. public function findThreats() {
  25. return uniqid();
  26. }
  27.  
  28. }
  29.  
  30. $mouse = new Mouse(1,1, "@");
  31.  
  32. $mouse->move();
  33.  
  34. echo $mouse->findThreats;
Success #stdin #stdout #stderr 0.02s 52432KB
stdin
Standard input is empty
stdout
1
stderr
PHP Notice:  Undefined property: Mouse::$findThreats in /home/smtvhE/prog.php on line 34