PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Web Services » Services_ExchangeRates » Bug #1983

Invalid argument supplied for foreach()

Details

Submitted2004-07-26 16:20 UTC
Frommichael dot klink at no-limits dot net
Assignedcross
StatusDuplicate
PackageServices_ExchangeRates
PHP Version4.3.6
OSWIN XP
Roadmaps(Not assigned)

Comments

[2004-07-26 16:20 UTC] michael dot klink at no-limits dot net

Description:
------------
What's this?

Warning: Invalid argument supplied for foreach() in c:\apacheserver\apache\htdocs\cmsCommerce\pear\WebServices\ExchangeRates\Rates_ECB.php on line 92

Warning: asort() expects parameter 1 to be array, null given in c:\apacheserver\apache\htdocs\cmsCommerce\pear\WebServices\ExchangeRates.php on line 237

Reproduce code:
---------------
$myExchangeRate = new Services_ExchangeRates('ECB', 'UN');
foreach($myExchangeRate -> validCurrencies as $code => $label) {
echo "".$code."". $label."";
}

[2004-07-26 16:28 UTC] michael dot klink at no-limits dot net

There is no array in Line 89 of Rates_ECB.php

$xrates = $root->children[2]->children[0]->children;

print_r($xrates); // no result given back

[2004-10-26 02:45 UTC] powtac at gmx dot de

Im not sure, but did something changed at PEAR:XML_TREE?