Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51873 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68021 invoked from network); 11 Apr 2011 23:30:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Apr 2011 23:30:52 -0000 Authentication-Results: pb1.pair.com header.from=martinscotta@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=martinscotta@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: martinscotta@gmail.com X-Host-Fingerprint: 209.85.212.42 mail-vw0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:43860] helo=mail-vw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 91/F5-24294-A2F83AD4 for ; Mon, 11 Apr 2011 19:30:51 -0400 Received: by vwl1 with SMTP id 1so5081003vwl.29 for ; Mon, 11 Apr 2011 16:30:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=H/cVTCIyh993i53vZ2/IeXVSC0FQ0Vq3RJNNqrhEdKo=; b=IkBN77Xxx87WkudM6PYZwuqQW1SC+2ZiPSZDzdlSW4yG3xqMag2vRSNxWVVMDkhmtQ Xdgf/wRupz59SzrDLQtKcmLCkecC0R7+m5T6Fls7+W/L9LRVZKNQvidfq/+8vOXRXHGu Zkuh5XS35eohYhbgWcOlb6eScvLUBWmQmcrNQ= 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; b=Mbr2Uv2pQtWuinJxFIDUYJJUCUZsNf8Z54madwalXKxVphqPoyxKhdhAiW2Buu9Fvf 4LzYGBe8oNBk9kKhgplcinxWpcfJQno7kqF9WtHBFsHPUBgqp536Had6nDdhRtQkPutF 8/CEDM5vdIPZR+8blmIEjAInOnSC2aeVMiEtc= MIME-Version: 1.0 Received: by 10.52.75.231 with SMTP id f7mr4209003vdw.158.1302564647670; Mon, 11 Apr 2011 16:30:47 -0700 (PDT) Received: by 10.220.177.77 with HTTP; Mon, 11 Apr 2011 16:30:46 -0700 (PDT) In-Reply-To: References: <4DA26602.6080303@lorenso.com> <20110411133657.GK7113@crousti> <4DA3468E.8000509@sugarcrm.com> <23.C1.24294.9CC43AD4@pb1.pair.com> Date: Mon, 11 Apr 2011 20:30:46 -0300 Message-ID: To: Chris Stockton Cc: "Matthew Weier O'Phinney" , internals@lists.php.net Content-Type: multipart/alternative; boundary=20cf3071cc521f12e504a0acf7f0 Subject: Re: [PHP-DEV] proposed access modifier "silent" ... was: Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator From: martinscotta@gmail.com (Martin Scotta) --20cf3071cc521f12e504a0acf7f0 Content-Type: text/plain; charset=ISO-8859-1 It seems that there are no consensus about this feature so... *if in doubt, leave it out.* Martin Scotta On Mon, Apr 11, 2011 at 5:09 PM, Chris Stockton wrote: > Hello, > > On Mon, Apr 11, 2011 at 11:47 AM, Matthew Weier O'Phinney > wrote: > > On 2011-04-11, Stas Malyshev wrote: > >> > 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." > > My suggestion to use ?? I will say has little to do with laziness. I > would be happy with any solution that solves my problem, I just know > that implementing a patch for ?? would be simple enough (I could even > do so if requested). Everyone has different use patterns as shown in > other examples, this is natural and just comes with the domain. > However, you may find 415,000 reasons why this feature could be useful > for developers in [1]. > > I also really like the ($foo['not exists'], $config['not > exists'], $foo, $bar, 'default') function. I personally only usually > need 1 default value but I feel like many people may find uses for > this as well. > > In addition I would like to mention that the checking being "isset" > for such a feature would be a very reasonable option, seeing as empty > [2], array_key_exists [3] (7000 uses found only) etc type use cases > are probably going to be a big minority. Most of the time checks done > with empty() seem to be done on known or already isset() checked, I.E. > isset($foo['bar']) && !empty($foo['bar']) anyways. > > Just some food for thought, > > -Chris > > [1] > http://www.google.com/codesearch?hl=en&lr=&q=.*isset\%28.%2B%3F\%29[\s]{0%2C1}\%3F&sbtn=Search > [2] > http://www.google.com/codesearch?hl=en&lr=&q=file%3A.*php+.*empty\%28.%2B%3F\%29[\s]{0%2C1}\%3F&sbtn=Search > [3] > http://www.google.com/codesearch?hl=en&lr=&q=.*array_key_exists\%28.%2B%3F\%29[\s]{0%2C1}\%3F&sbtn=Search > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --20cf3071cc521f12e504a0acf7f0--