Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87995 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85597 invoked from network); 1 Sep 2015 18:17:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Sep 2015 18:17:52 -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.173 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.173 mail-wi0-f173.google.com Received: from [209.85.212.173] ([209.85.212.173:35825] helo=mail-wi0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 78/E1-64170-FCBE5E55 for ; Tue, 01 Sep 2015 14:17:52 -0400 Received: by wicge5 with SMTP id ge5so16214573wic.0 for ; Tue, 01 Sep 2015 11:17:48 -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=zhcEJX4Uzr8C9gDJUOjXzzxLtG6qOd2NsZDyjML4AkM=; b=zHts8ncNAlWfgaPxpa16jOZ1QnjQUNsStJELcPv8Ucg6hC2V0a0zbstBDB4X9kBccu vZUGD2+3Zni1Es1Lay9Hn6nrYlC3nalTtKY7hp6e5VNkdHe7W5/bityVJckyWHvY2aOv 1xF9wmx1bXpzmABYMFvbuhITJRfzaC5+Uy8+tYdyZCpltCydjCYZOExnUj6p118x/MKe /x6+zYVdHKFuoJynD8yVFg6mfyTU/4xjJ1Z0cGcMhNd+8tY30RLPeJsLQD0Cc/nMYd/V 6LUhnUHxDZg+vYC2Qc75jscLxYZNCb1eJiuLl96PwSnUGLq1sLhRPGr5X4jC8hKQpDCo AHzQ== X-Received: by 10.194.133.73 with SMTP id pa9mr34635204wjb.148.1441131468734; Tue, 01 Sep 2015 11:17:48 -0700 (PDT) Received: from [192.168.0.5] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by smtp.googlemail.com with ESMTPSA id cm6sm3909139wib.22.2015.09.01.11.17.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Sep 2015 11:17:48 -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> <55DDD60F.5090509@gmail.com> <8C74463E-DBA2-4015-8159-0B44D973387F@craigfrancis.co.uk> <55DE0907.6040904@gmail.com> <1F615BCD-1B9B-4C51-A210-869F1AA1F6E3@craigfrancis.co.uk> Message-ID: <55E5EBBF.6020803@gmail.com> Date: Tue, 1 Sep 2015 19:17:35 +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: <1F615BCD-1B9B-4C51-A210-869F1AA1F6E3@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) On 01/09/2015 10:29, Craig Francis wrote: > Personally I still like the idea of an exists(), because I feel that is how many programmers treat and use the isset() function - simply because they do use NULL as a valid value, and either haven't read the manual, or forget the exception that is mentioned on line 1 (something I've done a couple of times). I'm still not sure how exists() would be anything other than an alias for array_key_exists(). Once again, this is NOT about "using NULL as a valid value"; it's about "using a variable's NON-EXISTENCE as a valid state". I think that is the fundamental mistake people make - they think the "quirk" is that isset() returns false for a null value, when that is the most rational part of it. The "quirk" is that you don't get a warning when passing a completely undefined variable to isset(). Obviously, that's not something that's likely to change, but as you say, what we are really testing is "the value pointed at by some identifier". In an array, that identifier can be dynamic, but in plain variable scope, that identifier is something you the programmer have defined long before the program executed, so its existence is never in question. Looked at that way, the handling of unitialised variables is just a side-effect of the handling of NULLs, since all unitialised variables have a default/implicit value of NULL. Regards, -- Rowan Collins [IMSoP]