> 
> 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?

But the method may use an array_*() function, which would cause problems if 
they're handed an ArrayAccess implementation. So there
is a difference.

Jared

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to