Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51844 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73248 invoked from network); 8 Apr 2011 16:05:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Apr 2011 16:05:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=mail_ben_schmidt@yahoo.com.au; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=mail_ben_schmidt@yahoo.com.au; sender-id=unknown; domainkeys=good Received-SPF: error (pb1.pair.com: domain yahoo.com.au from 98.139.91.80 cause and error) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: mail_ben_schmidt@yahoo.com.au X-Host-Fingerprint: 98.139.91.80 nm10.bullet.mail.sp2.yahoo.com Received: from [98.139.91.80] ([98.139.91.80:21038] helo=nm10.bullet.mail.sp2.yahoo.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 12/31-65418-9523F9D4 for ; Fri, 08 Apr 2011 12:05:46 -0400 Received: from [98.139.91.65] by nm10.bullet.mail.sp2.yahoo.com with NNFMP; 08 Apr 2011 16:05:43 -0000 Received: from [98.139.91.25] by tm5.bullet.mail.sp2.yahoo.com with NNFMP; 08 Apr 2011 16:05:43 -0000 Received: from [127.0.0.1] by omp1025.mail.sp2.yahoo.com with NNFMP; 08 Apr 2011 16:05:43 -0000 X-Yahoo-Newman-Id: 299674.57378.bm@omp1025.mail.sp2.yahoo.com Received: (qmail 8445 invoked from network); 8 Apr 2011 16:05:42 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.au; h=DKIM-Signature:Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=0sZV+4SWsXfStGgbbpSx/GU7vd3t7ah3CzDtOqsk/OkgVTOD+bHJKGOquYkbSU1gH3c4tWAPqZ2X6a4byTL/qHkt3eLSfjrsHOMDJy1QToNNgCNSRL1AkMG7y6rNZ0UaS6rLewwB93nkcJXoDqBJjDCUnkLN4gGJ9BkQDaEsGfg= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.au; s=s1024; t=1302278742; bh=A3MPrRWO+8dR1Qcs8XtlETxKsk73Sj6GhyYYJQ/WRGg=; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=wYHxH/KtFVyflsZQ0pHLSR+eIkvCRMyXR8fK/HxZV3p84sM+DZg1Z9oQnldX5D0f6dnjBhEeU3OfGNwoTjbndvGePh/kuOQiH0WLrat30M+1Dvd5fWBwXFtQ/kf9mfGm1aDfGFqODoAyQAaIRfNODFj3FbkNHO9hF542GhTEQLE= Received: from thought.local (mail_ben_schmidt@124.168.219.38 with plain) by smtp140.mail.mud.yahoo.com with SMTP; 08 Apr 2011 09:05:42 -0700 PDT X-Yahoo-SMTP: enFMnPSswBAexaHyzgobwuUTrYOhZdJ0KRA2SjA- X-YMail-OSG: 2cpU81EVM1nDCW.i2jPX886JVeyo2Jd7QFkQXHI7f7XiKnH JLhvUk1AuMOx0DrFKx_hXpZ2IgBZY3F7YihPfJfavppQUP.KjD2ZfmBLdmCT 7bgcjl2Pge_dAfBNKe3GHpVrX32VZRkGBSpkybKJnmDVRFbHQ0YMFGc46cRA zFa.lVxWfdGC1M4UCu8.2nqkuCxNb.TFhG8SkWrlDGqPG3Wehslbn3.WhoyW pv8vLnqyTIyKxoQrrqnfZYWHT3KIBqQJiunmRUTu2AL1ee1GE6FuVpSezct8 4mfQwNgZWhxj_WphKXEFgi1g41dpdQA26Wh1EkX4NFr.ebWVbA9XZgYqD4IR TLyNu7BqnDrilxs_vOYaxdoIMLA-- X-Yahoo-Newman-Property: ymail-3 Message-ID: <4D9F3256.5070108@yahoo.com.au> Date: Sat, 09 Apr 2011 02:05:42 +1000 User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-GB; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 ThunderBrowse/3.3.5 MIME-Version: 1.0 To: Martin Scotta CC: Hannes Landeholm , Rune Kaagaard , internals@lists.php.net References: <4D950434.3060704@yahoo.com.au> <4D9E0543.1080600@lerdorf.com> <69.82.36433.EC33E9D4@pb1.pair.com> <4D9E34C4.5000406@lerdorf.com> <4D9E429B.20503@sugarcrm.com> <4D9E96B6.6060401@lerdorf.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator From: mail_ben_schmidt@yahoo.com.au (Ben Schmidt) On 9/04/11 12:45 AM, Martin Scotta wrote: > I just feels that !empty($arr['key']) or isset($arr['key']) do not express > the real meaning, instead I would choose to write array_key_exists('key', > $arr). It may be slower but it clearly express what I meant. I don't like this. array_key_exists will return true for an array key that exists but is set to null, which is rarely what is wanted (though it sometimes is). I agree that the variants with empty() aren't very good. Just a single isset() variant seems like a good idea. I favour the ??: syntax. I liked the well-thought-out examples with assignment and chaining and so on. For chaining, does associativity matter? (Too tired to figure it out for myself right now!) Ben.