I want to write an easy battle in php between two characters (classes). This is my code:
class Characters
{
public $hp = rand(int,int);
public $attack = rand(int,int);
};
class You extends Characters
{
$hp = rand(10,20); //this is line 11
$attack = rand(2,10);
};
$player = new You;
echo $hp;
But the terminal is throws: 'unexpected $hp (T_VARIABLE) in /home/szigeti/Desktop/sublime/Game/Gameboard/index.php on line 11'.