errors suppressed when using PEAR_ERROR_CALLBACK with an object-based callback function

From: Date: Thu, 17 Jul 2003 06:25:29 +0000
Subject: errors suppressed when using PEAR_ERROR_CALLBACK with an object-based callback function
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-18327@lists.php.net to get a copy of this message
Hi, I am trying to raise a php error from within my PEAR error callback function, which is a member function of my error handler class. This will not work since when the callback function is invoked the @ operator is used to suppress errors. My question is this - why is the @ operator used on call_user_func when the callback is a member function, but not when it is a global function? Is there some fundamental reason that I am unaware of why the @ is used in this scenario but not for the global function callback? The code I'm talking about is in PEAR.php line 760: if ($this->mode & PEAR_ERROR_CALLBACK) { if (is_string($this->callback) && strlen($this->callback)) { call_user_func($this->callback, $this); } elseif (is_array($this->callback) && sizeof($this->callback) == 2 && is_object($this->callback[0]) && is_string($this->callback[1]) && strlen($this->callback[1])) { @call_user_func($this->callback, $this); } Thanks for any insights, Tristan.

« previous php.pear.dev (#18327) next »