Iterable object can't return object in key
| From: | mathieu.suen | Date: | Mon, 08 Feb 2010 14:31:12 +0000 |
| Subject: | Iterable object can't return object in key | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-46955@lists.php.net to get a copy of this message | ||
Hi,
Whenever you implement the Iterator interface the key method should only return a scalar.
Is there any particular reason for this restriction.
IMHO I don't see any.
I also don't see why you can't index an array with object but it smells something going wrong underneath.
Thanks
- Mathieu Suen