← All tasks
What you'll do
Pick the correct purpose of implementing __toString() on a class.
Scenario
echo $money; is used directly on an object of a custom Money class, and it prints a formatted value instead of an error.
Ready to try it?
Create a free account and subscribe to take "The __toString() Magic Method". Earn 70 XP and track your internship progress.
Already have an account? Sign in