Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51992 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72156 invoked from network); 23 Apr 2011 11:21:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Apr 2011 11:21:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=landeholm@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=landeholm@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: landeholm@gmail.com X-Host-Fingerprint: 209.85.214.170 mail-iw0-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:48474] helo=mail-iw0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 53/A1-55446-546B2BD4 for ; Sat, 23 Apr 2011 07:21:41 -0400 Received: by iwn3 with SMTP id 3so1200969iwn.29 for ; Sat, 23 Apr 2011 04:21:39 -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:content-type; bh=88B7dBcIcfoF/66xbIszqnEd5bzm0H6mGshaYwq/1zo=; b=uDkwP5LHSL1BJ2ShYiNFF2Pw5m1yDhATWnW1BcOEmxCoe8V3x6YXuRUua31WfyWgfK Cb3UN3JyD5tJP1vN0SK56AgyQF/V9/wkfhGDwg9OzJ3mXWlOE1JzvH4TLNqQhbAoE+PG MVbQPPlJm6BR7muHPvFGA2pAhuTNHjhRSRteE= 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 :content-type; b=HtCQc9U23iowhEqzGr1IlKCyvRro/9RKalAG2ZVp8JdDkXT7caFDsX9NTJ/WUPEsHQ GT0YZHLVtP98zm14YGMrua7BPi4kpc8jlzi/GgRsnGBmm3WFlNCNM/WAl1ZWqyN1Fktw yvSDmC95x74gZ0N0jqdw9miq4uJHsbAyLZTVU= MIME-Version: 1.0 Received: by 10.231.140.34 with SMTP id g34mr1389790ibu.195.1303557699051; Sat, 23 Apr 2011 04:21:39 -0700 (PDT) Received: by 10.231.37.140 with HTTP; Sat, 23 Apr 2011 04:21:38 -0700 (PDT) In-Reply-To: <4DB241FA.9040707@yahoo.com.au> References: <718216446.20110408143441@cypressintegrated.com> <4DA0E71C.9030008@gmail.com> <4DA63ED8.4080402@yahoo.com.au> <4DA6F2BC.10706@yahoo.com.au> <4DA6FB03.9040404@yahoo.com.au> <4DB23915.1040503@yahoo.com.au> <4DB241FA.9040707@yahoo.com.au> Date: Sat, 23 Apr 2011 13:21:38 +0200 Message-ID: To: Ben Schmidt , internals@lists.php.net Content-Type: multipart/alternative; boundary=0016e646129e98a51204a1942dfa Subject: Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator From: landeholm@gmail.com (Hannes Landeholm) --0016e646129e98a51204a1942dfa Content-Type: text/plain; charset=ISO-8859-1 I was planning on replying to the "coalesce" suggestion but you really took my concerns and stated them much better than I could have myself, plus a couple of other concerns I didn't even think about. To respond to Arpad Ray's statement: "To elaborate, I'd probably think this code was an unlikely series of typos, or an encoding error:" In my opinion that's a good thing. Then you might actually look it up in the documentation instead of making the assumption that the syntax has function-like properties just because it looks like a function. For example, it took me at least 1 year from first encountering empty() until understanding that it's not a normal function and actually a language construct that suppresses unset notices. And I'm a pretty seasoned programmer. There's only one thing worse than magic: hidden magic. ~Hannes On 23 April 2011 05:05, Ben Schmidt wrote: > It's good for some situations, but there are plenty more where it doesn't > cut it, e.g. $_GET[?'foo'] $:= get_default_from_db('foo') $: "hard-coded". > > Ben. > > --0016e646129e98a51204a1942dfa--