Re: PEAR::SOAP Undefined Offset
| From: | Justin Patrin | Date: | Wed, 11 Aug 2004 23:57:08 +0000 |
| Subject: | Re: PEAR::SOAP Undefined Offset | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-14074@lists.php.net to get a copy of this message | ||
On Wed, 11 Aug 2004 16:21:05 -0700, Craig Gardner <cgardner@adismri.com> wrote:
> I've created a SOAP function that works perfectly when it's not a SOAP
> function. When I call it as a SOAP function, I get a "Undefined offset:
> 4" message. Does anyone know how I might be able to fix this problem?
>
I believe SOAP ups the error reporting, meaning you get that warning.
It kinds sucks.
You didn't give any code, but here's what the warning means: you're
accessing an array and th ekey you're accessing doesn't exist.
$arr = array('key' => 'val');
return $arr['key2'];
Use isset():
if (isset($arr['key2'])) {
return $arr['key2'];
} else {
return '';
}
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--