DEV Community

Discussion on: Do they know it's C in PHP 🎄

 
andersbjorkland profile image
Anders Björkland

Yes, I get that about arrays. I was rather thinking about arrays vs generators, as compared to compilation ahead of time vs just-in-time compilation. I don't know what languages you are used to but I believe that generators are not unique to PHP. I did a benchmark on a simple generator vs array the other day where a million-element long array with its printing took about 35.7MB of memory and the generator took 544 bytes. Quite the difference!!