← All tasks
🧮
Programming Intermediate

Write an instanceof Check Against an Interface

⏱ 3 min ⭐ 90 XP 🔁 3 attempts allowed

What you'll do

Write the PHP expression that checks whether $logger implements the Psr\Log\LoggerInterface.

Scenario

You want to conditionally call a logging method only if the passed-in object actually satisfies the expected interface.

Ready to try it?

Create a free account and try "Write an instanceof Check Against an Interface" free for 7 days, no card required. Earn 90 XP and track your internship progress.

Already have an account? Sign in