Re: [PHP-XML-DEV] Empty xpath nodelist raises foreach error.
[email protected] (Philip Fletcher) Wed, 03 Mar 2004 11:44:59 +0000
| Newsgroups | php.xml.dev |
|---|---|
| Organization | Stutchbury |
| Message-ID | <[email protected]> |
I'm using the snap from this morning (php5-200403030830). I don't get any errors, just the warning. Philip Rob Richards wrote: > From: Philip Fletcher > > >> When using foreach() with an xpath query, if the xpath result is an empty >> set, then foreach raises a 'Warning: Invalid argument supplied for >> foreach()' message. This should not really be raised, as (for foreach()) >> the xpath return should be a valid (but empty) > > Are you using recent snap? This issue was fixed not too long ago. There > are a couple cases where it wont return an nodelist (issues errors in that > case though). > > Rob