{ } $rat = new Monster('Rat', 30); $goblin = new Monster('Goblin', 5); $ogre = new Monster('Ogre', 60); $hero = new Hero('Hero', 100); $monsters = array($rat, $goblin, $ogre); echo "<h3>Protecting our monsters</h3>"; foreach ($monsters as $monster) { // Fix the line below! echo "<p>" . $monster->getName() . ": " . $monster->getHealth() . "</p>"; } echo "<h3>A hero emerges!</h3>"; echo "<p>The noble {$hero->getName()} has vowed to defeat the monsters and save the realm.</p>"; echo "<p>Will they be victorious?</p>"; $hero->fight($monsters); if ($hero->isAlive()) { echo "<p>The hero {$hero->getName()} prevailed!</p>"; } else { echo "<p>{$hero->getName()} was bested by the monsters. We are doomed.</p>"; } $hero->attack($rat); echo "<br>"; echo "Hero health is " . $hero->getHealth(); echo "Monster health is " . $rat->getHealth(); ?> </p> </body> </html>