Why is there confusion around the value of the variable $karten in the PHP class?

The confusion around the value of the variable $karten in the PHP class may be due to the variable not being properly initialized or assigned a value within the class. To solve this issue, make sure to initialize the variable $karten with a default value or assign a value to it within the class constructor or a method.

class CardGame {
    private $karten = array(); // Initialize the variable with an empty array
    
    public function __construct() {
        // Assign a value to the variable within the constructor
        $this->karten = ['Ace', 'King', 'Queen', 'Jack'];
    }
    
    public function getKarten() {
        return $this->karten;
    }
}

$game = new CardGame();
$karten = $game->getKarten();
var_dump($karten);