A generator can be iterated once, and the second foreach over the same instance throws rather than returning nothing. Returning a generator from a method is therefore a…
A return inside finally overrides both the pending return value and any in-flight exception, with no diagnostic. This is almost always a mistake and there is no legitimate…
yield from preserves the inner generator’s keys, which means two delegated generators both starting at zero produce duplicate keys. The keys are preserved because yield from is delegation…
Five sequential API calls of 180 milliseconds each is nine hundred milliseconds of a request spent waiting, and they had no dependency on each other. Naming the requests…
The engine rejects a union containing the same type twice, and the check happens at compile time without loading any classes, so two aliases for one class pass.…
A function with high inclusive cost and negligible self cost is not slow — it calls something slow, and usually many times. The call count is the third…
Scanning four hundred classes for attributes took 2.9 seconds, which is fine once at deploy and unacceptable on every request. Compiling the reflection result to a plain PHP…