Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45365 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53731 invoked from network); 24 Aug 2009 22:08:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Aug 2009 22:08:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 72.14.220.157 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 72.14.220.157 fg-out-1718.google.com Received: from [72.14.220.157] ([72.14.220.157:27222] helo=fg-out-1718.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 35/79-03363-A4F039A4 for ; Mon, 24 Aug 2009 18:08:11 -0400 Received: by fg-out-1718.google.com with SMTP id e12so612418fga.0 for ; Mon, 24 Aug 2009 15:08:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=+Ike4/1AvU1G7xx7FLGVqPHZ2me6cjS/fX8QK7+ATe4=; b=Y9WVkP/CnDjIISEc2r22047005NA1gJnKG2rryDngni9O//Jv575P1n8/nqEt82W/J vlHo2H7DuID8Lr3HaWGRA7/0HMmoEPwxxHjlDwZyG6IOGnOB1HxIHC4AbkqMRJLmsSuE BiCG9NnEWQKipn7Y9RtIams6SdLej7pInaJZw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=cBb+bXANjfS9+mCG0s+2epnRrFHTNgE6s1GSmrugf+zmyZiE1AeODsYDfn+L5R0Ev8 5w8EEff4/q3oqoLTpL70m+C5K6D/j6+FLN2NkyHsd941OIEFhKVvzvDIXHJ6j3QsqEi7 dy8eDdW3rHHkhAg60k7l+5BHrnrZt3aMAvHO4= MIME-Version: 1.0 Received: by 10.86.103.19 with SMTP id a19mr3609227fgc.54.1251151687994; Mon, 24 Aug 2009 15:08:07 -0700 (PDT) In-Reply-To: <250F0E93-D6F2-490F-9129-598AC6E96500@pooteeweet.org> References: <4A92D936.2010107@zend.com> <4A92EA60.6020605@zend.com> <4A92F13B.9000204@zend.com> <4A92FFA8.1060401@zend.com> <4A9304FC.2000906@sci.fi> <4A930956.9070709@zend.com> <250F0E93-D6F2-490F-9129-598AC6E96500@pooteeweet.org> Date: Tue, 25 Aug 2009 00:08:07 +0200 Message-ID: To: Lukas Kahwe Smith Cc: Stanislav Malyshev , jani.taskinen@iki.fi, Ilia Alshanetsky , PHP Internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [patch] error masks From: pierre.php@gmail.com (Pierre Joye) hi Lukas, On Mon, Aug 24, 2009 at 11:51 PM, Lukas Kahwe Smith wrote: > > On 24.08.2009, at 23:42, Stanislav Malyshev wrote: > >> Hi! >> >>> Quite boring to read this thread where two persons argue about something >>> abstract. Stas, can you give a real life example where your patch is >>> necessary..? >> >> Any code where you either use @ or error_reporting which is not -1 would >> benefit from it by not processing errors that go nowhere. I just looked at >> Zend Framework - with is pretty clean with regard to E_NOTICE/E_STRICT >> problems - and @ is used in dozens of classes around. The speedup would be >> probably not very big for whole RL application, but it's a 10-line patch, >> and little things help too. > > > well a few of those places would probably be fixable, by providing functions > to check beforehand if calling the final function would cause an error. but > that if course would add more overhead, but would still be the "cleaner" > solution. To call a function to avoid a noisy or resource expensive error is just as bad. There are many common operations in PHP where we over react (file ops for example). As I agree with Rasmus' comments, I do think that this patch is the wrong fix for the real problem (that does not mean I do not like to have it in). I would however prefer to have APIs without any kind of noisy errors, at least for the common operations or where the error is obviously expected (as IO can fail). Please note that I did not suggest to use exceptions everywhere. Cheers, -- Pierre http://blog.thepimp.net | http://www.libgd.org