Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10139 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85497 invoked by uid 1010); 28 May 2004 07:40:45 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 85472 invoked by uid 1007); 28 May 2004 07:40:45 -0000 To: internals@lists.php.net, Derick Rethans Message-ID: <40B6ED03.4060708@procurios.nl> Date: Fri, 28 May 2004 09:40:51 +0200 User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) X-Accept-Language: en MIME-Version: 1.0 CC: internals@lists.php.net References: <20040527155047.GA36904@gravitonic.com> <20040527184929.GB23166@csh.rit.edu> <20040527190601.45769.qmail@pb1.pair.com> <20040527200440.GA38203@gravitonic.com> <20040527213949.29052.qmail@pb1.pair.com> <20040527225223.GA38890@gravitonic.com> <20040527230203.72676.qmail@pb1.pair.com> <20040528061941.18048.qmail@pb1.pair.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 80.126.99.118 Subject: Re: [PHP-DEV] [patch] re-invoking default error handler From: bert@procurios.nl (Bert Slagter) Derick Rethans wrote: > On Fri, 28 May 2004, Bert Slagter wrote: > > E_STRICT can not be handled you say, can you give a small example script > on that? > > regards, > Derick Of course :) ----------- foo = 0; class Foo { var $baz; function bar() { } } class Foo2 extends Foo { function bar($param1) { } } ?> ----------- This piece of sh.. erm code produces 4 E_STRICT errors: ----------- Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in test2.php on line 6 Strict Standards: Declaration of Foo2::bar() should be compatible with that of Foo::bar() in test2.php on line 16 Strict Standards: Non-static method Foo::bar() should not be called statically in test2.php on line 2 Strict Standards: Creating default object from empty value in test2.php on line 3 ----------- Now I add a custom errorhandler: ----------- We've got a $errno on line $errline in $errfile!

"; } set_error_handler('myErrorHandler'); error_reporting(0); Foo::bar(); $Foo->foo = 0; class Foo { var $baz; function bar() { } } class Foo2 extends Foo { function bar($param1) { } } ?> ----------- The output now is: ----------- Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in test2.php on line 14 Strict Standards: Declaration of Foo2::bar() should be compatible with that of Foo::bar() in test2.php on line 24 ----------- As you can see, two of the E_STRICT errors are still being displayed (this is logical, because they're cast on parse/compile time instead of runtime). The other two though, are not displayed but not passed to my handler either!! If I generate a notice (for example add $bar[a] = 0;) I instantly get an E_NOTICE in my own error handler for the undefined constant: ----------- We've got a 8 on line 13 in test2.php! ----------- So.. Why are the E_STRICTs not passed to my error handler? Bert