Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:6602 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2044 invoked by uid 1010); 19 Dec 2003 14:43:42 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 2020 invoked from network); 19 Dec 2003 14:43:41 -0000 Received: from unknown (HELO xaxa.search.ch) (195.141.85.118) by pb1.pair.com with SMTP; 19 Dec 2003 14:43:41 -0000 Received: from localhost (localhost [127.0.0.1]) by xaxa.search.ch (Postfix) with ESMTP id CD8E76DB1F; Fri, 19 Dec 2003 15:43:35 +0100 (CET) Received: by xaxa.search.ch (Postfix, from userid 65534) id CBDF16D8B0; Fri, 19 Dec 2003 15:43:34 +0100 (CET) Received: from cschneid.com (ultrafilter2-i [192.168.85.3]) by xaxa.search.ch (Postfix) with ESMTP id 35AAE6D8AD; Fri, 19 Dec 2003 15:43:34 +0100 (CET) Message-ID: <3FE30E95.5090707@cschneid.com> Date: Fri, 19 Dec 2003 15:43:33 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030626 X-Accept-Language: de-ch, en-us, en MIME-Version: 1.0 To: Daniel Convissor Cc: PHP Internals List References: <841D90E489448A4F804E1D1B95768BF7D462F7@lis-exchange3.lmu.ac.uk> <20031219141634.GA27956@panix.com> <20031219142636.GB27956@panix.com> In-Reply-To: <20031219142636.GB27956@panix.com> X-Enigmail-Version: 0.76.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on xaxa.search.ch X-Spam-Level: X-Spam-Status: No, hits=-4.9 required=5.0 tests=BAYES_00 autolearn=ham version=2.61 X-Virus-Scanned: by AMaViS 0.3.12pre8 Subject: Re: [PHP-DEV] error_handler From: cschneid@cschneid.com (Christian Schneider) Daniel Convissor wrote: > On Fri, Dec 19, 2003 at 03:20:17PM +0100, Derick Rethans wrote: > >>It is when it's optional and the default is the current behavior. > > Pardon me. Looks like PHP 3 behavior is still stuck in my brain... No, you were right. A script using set_error_handler("handler", error_reporting()); will get "Wrong parameter count for set_error_handler()" for PHP4. So you force people to lock their code to PHP5 if they want to use the new semantics. Not good for migration. Another approach would be that set_error_handler() copies the current error_reporting mask. But that leads to confusing situations if error_reporting is changed later on. Would need good documentation to explain it. After thinking about it I come to the conclusion that coupling the error handler to error_reporting is the right thing to do. I believe we can live with the _very_ rare case where people expect the error handler to be called for everything *AND* they have error_reporting to something else than E_ALL. That would also remove a WTF-situation (I was quite surprised when my error handler got called for E_NOTICE even though I disabled it in error_reporting). - Chris