DEV Community

Discussion on: How to fix the PHP fatal error: allowed memory exhausted? (From the office!)

Collapse
 
marcusatlocalhost profile image
Marcus

I use generators rarely, because the use cases are limited. This comment described it quite well: https://www.reddit.com/r/PHP/comments/wgu97y/comment/ij25qgi/?utm_source=reddit&utm_medium=web2x&context=3
There are only so many cases where one is "streaming" and processing content. Like reading a log file or CSV file. In those cases, the performance/memory consumption was notable.

Thread Thread
 
anastasionico profile image
anastasionico

yes, I agree with you they are very good in what they do but they are very...'niche'.

I also like array functions (like array_map, array_filters etc) and love the Illumitante's Collections.
have you ever use it, it's lifechanging?

Thread Thread
 
marcusatlocalhost profile image
Marcus

Yeah Laravel Collections are awesome (I read your blog post about the book "Refactoring Collection" too, I didn't read the book yet, because I already know about the power of collections :))

I even used collection.js in a project because I memorized most methods anyway and it was easy to port certain code.

Thread Thread
 
anastasionico profile image
anastasionico

oh great thank you so much