fork download
  1. <?php
  2.  
  3.  
  4. class DiceGame
  5. {
  6. public $gameRounds = 0;
  7. public $aiPoints=0;
  8. public $playerPoints=0;
  9.  
  10. }
  11.  
  12. $game = new DiceGame;
  13.  
  14. echo $game->$playerPoints;
  15.  
  16.  
  17.  
Runtime error #stdin #stdout #stderr 0.02s 24448KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Notice:  Undefined variable: playerPoints in /home/NWmTQU/prog.php on line 15
PHP Fatal error:  Cannot access empty property in /home/NWmTQU/prog.php on line 15