← All tasks
🌳
Programming Beginner

Visibility Modifiers: public, protected, private

⏱ 3 min ⭐ 70 XP 🔁 3 attempts allowed

What you'll do

Pick the correct rule about which code can access a private property.

Scenario

A subclass tries to access $this->secret, declared as private in the parent class, and gets an error.

Ready to try it?

Create a free account and try "Visibility Modifiers: public, protected, private" free for 7 days, no card required. Earn 70 XP and track your internship progress.

Already have an account? Sign in