Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45367 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56172 invoked from network); 24 Aug 2009 22:12:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Aug 2009 22:12:46 -0000 Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 63.205.162.117 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 63.205.162.117 us-mr1.zend.com Linux 2.4/2.6 Received: from [63.205.162.117] ([63.205.162.117:50174] helo=us-mr1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 53/0A-03363-E50139A4 for ; Mon, 24 Aug 2009 18:12:46 -0400 Received: from us-gw1.zend.com (us-ex1.zend.net [192.168.16.5]) by us-mr1.zend.com (Postfix) with ESMTP id 0329EE1243; Mon, 24 Aug 2009 15:00:00 -0700 (PDT) Received: from [192.168.16.83] ([192.168.16.83]) by us-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 24 Aug 2009 15:13:49 -0700 Message-ID: <4A931054.4080601@zend.com> Date: Mon, 24 Aug 2009 15:12:36 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Rasmus Lerdorf CC: Lukas Kahwe Smith , jani.taskinen@iki.fi, Ilia Alshanetsky , 'PHP Internals' References: <4A92D936.2010107@zend.com> <9E8BD3A3-8915-4492-88A9-7EA1A0CF6D86@prohost.org> <4A92DC60.2050606@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> <4A930D54.6050705@lerdorf.com> In-Reply-To: <4A930D54.6050705@lerdorf.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 24 Aug 2009 22:13:49.0506 (UTC) FILETIME=[28080220:01CA2508] Subject: Re: [PHP-DEV] [patch] error masks From: stas@zend.com (Stanislav Malyshev) Hi! > Lukas, the problem is that all messages, E_STRICT, E_DEPRECATED, > E_NOTICE, whatever, all cause a performance hit even if the > error_reporting level is such that they will never show up anywhere. > That's what this patch is trying to address. To write optimal code, > they have to be entirely clean of all messages including E_DEPRECATED > and E_STRICT. BTW "cleaning the messages" won't help with performance problems in many cases. Let's suppose you have a code that tries to open some file and if it exists, do stuff (and if it doesn't it doesn't care): $fp = @fopen($filename, "r"); if($fp) { // do stuff } Now if you "clean" it, you do something like: if(is_readable($filename)) { $fp = fopen($filename, "r"); // do stuff } (and if you don't want race condition there, you still need the if()). Then is_readable and fopen can still can't be guaranteed to not produce warnings if there are open_basedir restrictions or streams involved or FS could change in the meanitime. But now instead of one FS access, you have two - not much of a speedup. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com