array type hint and SPL array interfaces
| From: | Tobias Schlitt | Date: | Tue, 09 May 2006 10:56:19 +0000 |
| Subject: | array type hint and SPL array interfaces | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-23214@lists.php.net to get a copy of this message | ||
Hi Marcus!
I wondered, why PHP complains, if you have an array type hint in a
method prototype and provide an object to this method, that implements
the SPL interfaces to use objects as arrays. I would expect that, if an
object can be handled exactly like an array, PHP should not complain,
since the implementation of the method would not notice the difference.
Or am I wrong?
Regards,
Toby
--
Tobias Schlitt - Zend Certified Engineer NEW GPG Key: 0xC462BC14
a passion for php http://www.schlitt.info
Like to say "thank you"? - http://pear.php.net/wishlist.php/toby