I have 2 classes, one extends the other:
class Human {
const PERKS = 'none';
public function __construct() {
echo self::PERKS;
}
}
class King extends Human {
const PERKS = 'crown';
}
Ignore the silly example. However, no matter whom I initialize I get printed 'none'.
- How exactly does the constructor work?
- How can I get around this?
Thank you.