Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87933 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94061 invoked from network); 26 Aug 2015 15:08:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Aug 2015 15:08:04 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.172 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.172 mail-wi0-f172.google.com Received: from [209.85.212.172] ([209.85.212.172:35578] helo=mail-wi0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 89/74-17883-F46DDD55 for ; Wed, 26 Aug 2015 11:08:03 -0400 Received: by wicne3 with SMTP id ne3so47885697wic.0 for ; Wed, 26 Aug 2015 08:07:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=QP2+l5u0ZwefIVspzICAlZ/1r95o8nF6pj4Z3ZWPWiY=; b=xNFxElyoNd7LdrGBZZFvu5gbug0uW+R2gQcoZ8f/oAgWNsYZ+0lK+bGWcM1HDCFAgD dmf9cj4weIbidr3nVLFuaeitsOWLe+yq1JYGKs48IrNOk+PbY1Up1dfY1AYapio+6FQv Z0x4oGMLVZkH+xil99zNc1zQm2BxYmPDPg3OEf8RaaYXFVPnzIzBma/oydLNAowMlHIx Z1NP7DtMllzs89ipRi5AKHydT46eotnYEkOtEJUA80nZPtabogGA3+req/ZgbbKX7Du/ Jw7MFDkzbOjF4nNOVP72L8i8VVGaDl4HOVg3E5G5tFR+IuX3lT26WP+jnDahvSFuBlWp gmng== X-Received: by 10.194.175.233 with SMTP id cd9mr59119234wjc.68.1440601676401; Wed, 26 Aug 2015 08:07:56 -0700 (PDT) Received: from [192.168.0.83] ([62.189.198.114]) by smtp.googlemail.com with ESMTPSA id p3sm8043085wib.16.2015.08.26.08.07.51 for (version=TLSv1/SSLv3 cipher=OTHER); Wed, 26 Aug 2015 08:07:52 -0700 (PDT) To: internals@lists.php.net References: <55DD4269.4090402@gmail.com> <6348DFA7-04BD-41BB-A500-17A8A531B56C@craigfrancis.co.uk> <55DDA4C9.9040603@gmail.com> <3C69BF4B-52E6-4D04-8601-8D23DFCC538E@craigfrancis.co.uk> Message-ID: <55DDD60F.5090509@gmail.com> Date: Wed, 26 Aug 2015 16:06:55 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <3C69BF4B-52E6-4D04-8601-8D23DFCC538E@craigfrancis.co.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28? From: rowan.collins@gmail.com (Rowan Collins) Craig Francis wrote on 26/08/2015 14:53: > On 26 Aug 2015, at 12:36, Rowan Collins wrote: > >> Fortunately, the function you are looking for already exists: http://php.net/array_key_exists > It does, although I seem to have edited that out of my reply... was trying to keep it short ;-) You could have kept the reply even shorter by omitting examples for which the language already provides the solution ;) > At the moment I'm out of examples (bit busy at the moment), but I do know that when I'm doing an isset() check, I'm really wanting to know if the variable (or key) exists Stop. As soon as you say "or key" you completely defeat your argument. The whole thing is ONLY worth discussing if you can come up with an example of an actual variable having unknown existence. > where NULL may be a perfectly valid value. It's not that NULL isn't a valid value; it's that "doesn't exist" isn't a meaningful state for a variable. It's like checking if the current line number is greater than 100, it shouldn't mean anything to the compiled program. See the SO answer I linked earlier for more thought experiments along these lines. Regards, -- Rowan Collins [IMSoP]