Skip to content

Instantly share code, notes, and snippets.

View gajosadrian's full-sized avatar
🏠
Working from home

Gajos gajosadrian

🏠
Working from home
View GitHub Profile
@gajosadrian
gajosadrian / rebilly-developer-coding.md
Created August 18, 2026 17:56
Rebilly Developer Coding

PHP / JavaScript / TypeScript Exercise

Question 1

fetchAll() loads the whole result set into PHP memory before the loop starts. With a large table this can easily exceed the configured memory limit.

I would process the rows one at a time instead:

$stmt = $pdo->prepare('SELECT * FROM largeTable');