Start your All-Access Pass to unlock this challenge
Challenge 1 / 1
Check out the following code:
// Ship.php
class Ship
{
public $name;
protected $weaponPower;
private $defense;
public function getDefense()
{
return $this->defense;
}
}
// JediShip.php
class JediShip extends Ship
{
public function getWeaponPower()
{
return $this->weaponPower;
}
}
// index.php
$jediShip = new JediShip();
$jediShip->name;
$jediShip->weaponPower;
Which of the above code will give us an error?
Skip challenges and go to theNext Chapter