foreach changed from php 4 to 5?
Posted by: byosmosis
Posted on: 2006-05-31 22:38:00
I have the following chunk of code which seems to work fine on 4 and throws warnings under 5...
foreach($indexR as $key => $value){ ## goes thru the search
list($siteIndexTitle) = getPageTitle($value); ## get page titles and href
foreach($siteIndexTitle as $kk => $vv){ ## this is line 39
$dirListingArray[$kk] = $vv; }
}
php 4 site:
byosmosis.com/sitemap.html
php5 site:
samba.byosmosis.com/sitemap.html
php5 errors:
Warning: Invalid argument supplied for foreach() in /home/.fiery/byosmosis2/samba.byosmosis.com/sitemap.php on line 39
Warning: Invalid argument supplied for foreach() in /home/.fiery/byosmosis2/samba.byosmosis.com/sitemap.php on line 39
Warning: Invalid argument supplied for foreach() in /home/.fiery/byosmosis2/samba.byosmosis.com/sitemap.php on line 39
Any ideas about what might be going wrong? My first thought was there was a difference in the treatment of "nested foreachs" between the versions, also I thought maybe there was something in the local env of the 5 server that constituted an "invalid argument" being passed into the array. But I don't see anything unique from one env to the other really.
Any help appreciated,
ByOsmosis