Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51866 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32523 invoked from network); 11 Apr 2011 18:21:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Apr 2011 18:21:08 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.133 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.133 smtp133.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.133] ([67.192.241.133:41203] helo=smtp133.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6B/01-24294-19643AD4 for ; Mon, 11 Apr 2011 14:21:07 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp23.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 267032F8162; Mon, 11 Apr 2011 14:21:03 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp23.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id E14762F81F4; Mon, 11 Apr 2011 14:21:02 -0400 (EDT) Message-ID: <4DA3468E.8000509@sugarcrm.com> Date: Mon, 11 Apr 2011 11:21:02 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: Michael Morris CC: Internals Mailing List References: <4DA26602.6080303@lorenso.com> <20110411133657.GK7113@crousti> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] proposed access modifier "silent" ... was: Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > I might come off rather crumudgeonly here, but these last few threads I've > seen going across to > silence notices have a common theme - "I wanna be a lazier coder." Laziness is a virtue for a coder :) At least, when it goes to avoid unnecessary work - in this example, boilerplate code. > Which is fine - set the PHP error level to not show them. This is not good enough - "not showed" errors are still generated and are quite expensive. > But don't ask the engine to be rewritten to encourage bad coding practices > which failing to properly initialize variables is a prime example of. It's The case we're dealing with is specifically about providing resolution for the case when the value is not initialized and the default value is provided. It is about making good code easier to write ("$foo[$bar] ?? $baz" instead of "isset($foo[$bar])?$foo[$bar]:$bar"). -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227