On 14 Jul 2014, at 18:52, Zeev Suraski <z...@zend.com> wrote:

> Type hints were first and foremost introduced for object oriented safety, as
> a part of the major OO model shift Andi and I pushed for in PHP 5.0.  What
> you may be alluding to - type hints for arrays and objects - were added at
> later time and introduced that small inconsistency you're talking about.
> Still, type juggling for scalars has been the fundamental nature of PHP
> since the get go;  Type jugging for arrays/objects was always more of an
> edge case and perhaps even a misfeature.

I’m not sure we actually do “juggle” arrays and objects much, do we? You can 
cast to them, sure, because PHP as a rule allows you to cast anything to 
anything explicitly (bar resources), but I can’t, for example, do a loose 
comparison between an array and a string.

--
Andrea Faulds
http://ajf.me/





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

Reply via email to