>>17
Yeah, PHP's
foreach is a hackish builtin which can only operate on arrays. Add to that the weird type juggling semantics (where, at any time each variable
has a distinct type, but can be implicitly converted to any another type to fulfill the needs of an operation) and you've got a giant mess.
Python's
foreach works with anything that provides an
__iter__ method, and practically everything that you'd want to iterate over does. <3 FIOC.