Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51872 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51661 invoked from network); 11 Apr 2011 20:09:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Apr 2011 20:09:15 -0000 Authentication-Results: pb1.pair.com smtp.mail=chrisstocktonaz@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=chrisstocktonaz@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: chrisstocktonaz@gmail.com X-Host-Fingerprint: 209.85.210.42 mail-pz0-f42.google.com Received: from [209.85.210.42] ([209.85.210.42:32885] helo=mail-pz0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 81/34-24294-AEF53AD4 for ; Mon, 11 Apr 2011 16:09:15 -0400 Received: by pzk4 with SMTP id 4so2397694pzk.29 for ; Mon, 11 Apr 2011 13:09:11 -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=Uoik7leqmkYCqLPhgcWjjgFmqlx0Uf5kUkPrZ3hE/Ck=; b=g4GS5Yxbh15P9DEtAj2yRkUjDwHWAzj8Fel1dRRrJOzNEOotIIzn2K5Q+Lx9yjvhRk fvlikkkTlrZu04Xm+y7sbxrQelQDpmV8c776t/cUfwLeQr7yO+IRq4aT+JTpauU5YwoM frxTZF3THIf4bP/9vVCU0wnDLFdGnaG/7DHy8= 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=NTIwRsa1BDa7cNp7afPPlgw4ojosvVxWNWc3Kg/kr0d/hRVLq6xfuVMWm/lD540aWO wPHqxfZodKyacXF8L9PR1Q0MU6jlBv+gLcUgEfh7BRf1+kdQECCnR7Ny3oUHUFKZPm8g wL9dYBqb2gHIWah0q91Uhij5KEkwVlMA/VmtQ= MIME-Version: 1.0 Received: by 10.142.178.14 with SMTP id a14mr4102827wff.433.1302552551214; Mon, 11 Apr 2011 13:09:11 -0700 (PDT) Received: by 10.68.66.10 with HTTP; Mon, 11 Apr 2011 13:09:10 -0700 (PDT) In-Reply-To: <23.C1.24294.9CC43AD4@pb1.pair.com> References: <4DA26602.6080303@lorenso.com> <20110411133657.GK7113@crousti> <4DA3468E.8000509@sugarcrm.com> <23.C1.24294.9CC43AD4@pb1.pair.com> Date: Mon, 11 Apr 2011 13:09:10 -0700 Message-ID: To: "Matthew Weier O'Phinney" Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] proposed access modifier "silent" ... was: Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator From: chrisstocktonaz@gmail.com (Chris Stockton) 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