Hello Jochem, Thursday, October 27, 2005, 12:49:57 PM, you wrote:
> Jani Taskinen wrote: >> On Thu, 27 Oct 2005, Jochem Maas wrote: >> >>> advanced code should be checking vars properly before using them and, >>> well, >>> for any given foreach loop there is often enough an 'if >>> (!count($array))'-like >>> statement to take care of the 'empty' case. and in cases when speed is >>> very important >> >> >> ..and where count() magically returns 1 f.e. for FALSE. :) >> So really you can't rely on that. :) > true - although personally I always do if(is_array($r) && count($r)) in such > cases. > so it seems that there is inconsistency regardless of > whether the warning is removed or not. > out of interest what are the ramifications for SPL and simpleXML > if the warning is not dropped? Right now ther is no place in SPL that would benefit. But both SXE and PDO have to create empty instances to allow code that does not need further cehecks before sending to foreach(). So the idea is actually some speed improvement and in case of SimpleXML i'd like to be able to check existance of a sub element by the following: !is_null($sxe->element) Best regards, Marcus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php