Hello Christian,

Tuesday, October 25, 2005, 7:28:09 PM, you wrote:

> Ants Aasma wrote:
>> +-0 on the foreach issue, but with the SPL Iterators I can see where 
>> Marcus is coming from.

> Ok, I can see the reason behind it now as casting to array is not an 
> option for objects with SPL Iterators. One little side-note: Programmers 
> will still have to do an if($obj) check if they use $obj for just about 
> anything but foreach.

> After thinking it over you convinced me that treating null (and only 
> null) like an empty array in foreach() might be a good idea, probably 
> even for the non-SPL case.

Hey you two guys pointed out the reason very exactly! Only the usecase
wasn't SPL but a potential change i want to do in SimpleXML and the reson
SXE behaves like it currently does. But yes SPL and PDO would probably
benefit in the same way.

Best regards,
 Marcus

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

Reply via email to