Re: set_error_handler() not handling E_ERROR
| From: | Chris Newbill | Date: | Sun, 14 Jan 2001 06:14:36 +0000 |
| Subject: | Re: set_error_handler() not handling E_ERROR | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-44042@lists.php.net to get a copy of this message | ||
Skimming the Zend code...
Calls to undefined functions, class methods, and the like.
What would be the cons of having these type of errors simply causing
E_USER_ERROR instead of E_ERROR? That way they would be trapable and I
don't think it would cause a problem if the user does not have a custom
error handler.
Changed the zend_execute.c file to E_USER_ERROR on undefined functions and
method calls on non-object, PHP works fine and doesn't core.
Chris Newbill
> Okay, guess I'll have to wait for those changes then. Maybe included in
> 4.0.5?? =)
>
> Thanks,
> Chris Newbill
>
> ----- Original Message -----
> From: "Rasmus Lerdorf" <rasmus@php.net>
> To: "Chris Newbill" <cnewbill@onewest.net>
> Cc: <php-dev@lists.php.net>
> Sent: Saturday, January 13, 2001 10:51 PM
> Subject: Re: [PHP-DEV] set_error_handler() not handling E_ERROR
>
>
> > This was covered recently. See
> >
> > http://marc.theaimsgroup.com/?l=php-dev&m=97673386418430&w=2
> >
> > On Sat, 13 Jan 2001, Chris Newbill wrote:
> >
> > > PHP Version 4.0.3pl1 and 4.0.4
> > >
> > > It was my understanding that when using set_error_handler() ALL errors
> were
> > > sent to the users function? This does not seem to be happening.
> > >
> > > error.lib
> > > $oeh = set_error_handler("dosojin_ERROR");
> > >
> > > error_reporting(E_ERROR | E_WARNING | E_PARSE | E_CORE_ERROR |
> > > E_COMPILE_ERROR | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE);
> > >
> > > tmp.php
> > > <?
> > >
> > > include("dosojin.lib"); // constants only
> > > include("error.lib"); // error handling routines
> > >
> > > function foo($var)
> > > {
> > > print "Hello, $var!\n";
> > > }
> > >
> > > foo();
> > >
> > > $i = 1;
> > > $i->noFunc();
> > >
> > > ?>
> > >
> > > # php -q tmp.php
> > > <PRE CLASS=error>
> > > (2) Missing argument 1 for foo()
> > >
> > > </PRE>
> > > Hello
> > > <br>
> > > <b>Fatal error</b>: Call to a member function on a non-object in
> > > <b>tmp.php</b> on line <b>14</b><br>
> > >
> > > You can see that E_WARNING is getting shuffled to the user function,
but
> > > E_ERROR is not.
> > >
> > > Thanks,
> > > Chris Newbill
> > >
> > >
> > > --
> > > PHP Development Mailing List
> > > <http://www.php.net/>
> > > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> > > For additional commands, e-mail: php-dev-help@lists.php.net
> > > To contact the list administrators, e-mail:
php-list-admin@lists.php.net
> > >
> >
> >
> > --
> > PHP Development Mailing List <http://www.php.net/>
> > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-dev-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>