I have a simple doubt about PHP. I have the following code in a file called gato.php:
class Animal{
public $foodLevel=5;
}
class Cat extends Animal{
}
Then I have another file in which I have:
include_once "gato.php";
$susi = new Cat();
echo $susi->$foodLevel;
And I get the following errors:
Undefined variable: foodLevel
Can not access empty property
How could I access the variable foodLevel from the second file?