Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:3573 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26648 invoked from network); 23 Jul 2003 08:07:49 -0000 Received: from unknown (HELO mail.wp-sa.pl) (212.77.102.105) by pb1.pair.com with SMTP; 23 Jul 2003 08:07:49 -0000 Received: from wp-sa.pl (it.wp-sa.pl [212.77.105.136]) by mail.wp-sa.pl (iPlanet Messaging Server 5.1 (built May 7 2001)) with ESMTPS id <0HIG00LA4X90EG@mail.wp-sa.pl> for internals@lists.php.net; Wed, 23 Jul 2003 10:07:48 +0200 (CEST) Date: Wed, 23 Jul 2003 10:04:56 +0200 In-reply-to: <1058913250.22615.123.camel@localhost> To: Timm Friebe Cc: internals@lists.php.net Message-ID: <3F1E41A8.6040106@wp-sa.pl> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.4a) Gecko/20030404 References: <3F1D78DB.20905@wp-sa.pl> <1058913250.22615.123.camel@localhost> Subject: Re: [PHP-DEV] Feature proposal From: wmeler@wp-sa.pl (Wojtek Meler) Timm Friebe wrote: > On Tue, 2003-07-22 at 19:48, Wojtek Meler wrote: > >>I have to fight with people that using error suppression operator - they >>just hide their bugs. >>I wrote simple patch that allows set disable_error_suppression=On in >>php.ini that causes engine to ignore '@' operators. > > > Use set_error_handler(), then; the callback function is called > regardless whether the error suppression "operator" @ was used. > > thekid@friebes:~ > php -r 'function handler() { > var_dump(array_pop(array_slice($a= func_get_args(), 1, 1))); } > set_error_handler("handler"); @include("foo");' > ^^^^^^^^^^^^^^^ > > string(64) "Unknown(foo): failed to create stream: No such file or > directory" > string(116) "Unknown(): Failed opening 'foo' for inclusion > (include_path='.:/home/thekid/devel/xp/skeleton:/home/thekid/classes')" > > - Timm > > but try this : php -r 'function handler() { var_dump(array_pop(array_slice($a= func_get_args(), 1, 1))); } set_error_handler("handler"); @nonexist();echo "and now what?";' regards Wojtek