Re: strange error

From: Date: Thu, 25 Oct 2007 13:37:21 +0000
Subject: Re: strange error
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-263655@lists.php.net to get a copy of this message
2007. 10. 25, csütörtök keltezéssel 09.15-kor Jeff Mckeon ezt írta: > I'm getting this error on a php based ticket system we have. I don't see > this on the old server running php4. This new server is running php5. > > PHP_Fatal_error:__Cannot_use_object_of_type_PEAR_Error_as_array_in_/srv/www/ > virtual/support/mailparser.php_on_line_300/ > > The code in that section looks like this... > > function firstemail($addrs) > { > $name=""; > $structure = Mail_RFC822::parseAddressList($addrs); > $ret= $structure[0]->mailbox."@".$structure[0]->host; ### line 300 is > here... > if ($ret=="@localhost") $ret=""; > else $name=$structure[0]->personal; > return array($ret,$name); > } > > Any idea what may be the issue here? the class Mail_RFC822 encountered some error, and thus returned a PEAR_Error object. on the next line you try to access it as an array, which of course throws a fatal error. try to dump out the error object to see what is the pear error encountered. greets Zoltán Németh >

« previous php.general (#263655) next »