Object Oriented Programming (Course 1)
Private Access
  Start your All-Access Pass to unlock this challenge
Buy Access Login

Challenge 1 / 1

Check out this delicious class:

class Pizza
{
    private $toppings = [];
}

Now, from outside the class, you try saying:

$pizza = new Pizza();
$pizza->toppings = ['pineapple'];

Apart from the fact that pineapple is so delicious on a pizza (yes, I'm know I'm starting a fight!), what would happen with this code?

Skip challenges and go to theNext Chapter

Turn Challenges Off?

All further challenges will be skipped automatically.
You can re-enable challenges at any time on this page or from your account page.