Write the PHP generator function readLines($path) that yields each line of a file one at a time instead of returning a full array.
Scenario
You're processing a huge log file and want to avoid loading it entirely into memory.
Ready to try it?
Create a free account and try "Write a Generator Function Using yield" free for 7 days, no card required. Earn 90 XP and track your internship progress.