PHP: iterators, null, closure