Today the PHP team released the PHP 5.5.0 version, which includes support for generators. Reading the documentation, I noticed that it does exactly what it coul
Generators allow for lazy evaluation of complex statements. That way you save memory as you don't have to allocate everything at once.
Besides both being iterable they aren't nearly the same. An array is a data structure, a generator is not.
array