Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88349 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98662 invoked from network); 18 Sep 2015 18:26:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Sep 2015 18:26:00 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.175 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.175 mail-wi0-f175.google.com Received: from [209.85.212.175] ([209.85.212.175:35876] helo=mail-wi0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 24/67-60254-7375CF55 for ; Fri, 18 Sep 2015 14:25:59 -0400 Received: by wicgb1 with SMTP id gb1so43218422wic.1 for ; Fri, 18 Sep 2015 11:25: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=XWU+x41/wUjKIi34qwLQEZXWMsN6REDKQySgBQFgVsU=; b=SuvWvUYqxsQIQnxJxV/ETzKpfG0bxlS1KWyiJlOoIegONWBMMVGHZA/zs9JOycxA9D gsPP7dy6eeEnVhPrrLBHylrFBuD8SWTePPaRRCf6jvo/d/ihooaXnXSRmouJugqm02AA w6omDn7WGUDY9VBMDeJ51/nMwBg8prXrPAmzRqWczqJn78SIeoX6KWgEHts/+Oz5LXfB gFRlM67+rC/slGcLywgYHU/qCxn86fAQt7ddLCqeljVU1kNjuHI8spBO1MkYxgywthZM AkNoxqzcsGd3ZwW2MyZ9xL1fZTpEMfyo5YrWcj5MPnrXOKWeyFLCPgP1mlIwLMVGPSD5 AW3w== X-Received: by 10.194.113.1 with SMTP id iu1mr9760115wjb.158.1442600756556; Fri, 18 Sep 2015 11:25:56 -0700 (PDT) Received: from [192.168.0.127] ([62.189.198.114]) by smtp.googlemail.com with ESMTPSA id p20sm16821968wie.5.2015.09.18.11.25.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Sep 2015 11:25:55 -0700 (PDT) To: internals@lists.php.net References: <55F9B4C7.3050700@gmail.com> <440C64A2-4B4F-4AEF-ACE3-F3A6637EBAB6@thesba.com> <55F9D704.5050002@lsces.co.uk> <55F9EFA2.9020908@lsces.co.uk> <0022A1D9-DC37-4F49-B58E-FBED5AF872BA@gmail.com> <55F9FAB3.2050100@lsces.co.uk> <55FB19CB.7080707@gmail.com> <55FB3117.5040204@lsces.co.uk> <55FB3A60.1040601@gmail.com> <55FB4270.7000204@lsces.co.uk> <55FB4969.7080600@gmail.com> <55FB5BA6.6050606@lsces.co.uk> <55FBF265.5000502@gmail.com> <55FBF7B7.4050603@lsces.co.uk> <55FC1A77.7090406@gmail.com> <55FC221A.7020108@lsces.co.uk> <55FC2588.6030809@gmail.com> <55FC2B17.3070909@lsces.co.uk> <55FC2F2F.9060403@gmail.com> <55FC33F1.3090903@lsces.co.uk> <55FC354B.5070209@gmail.com> <55FC39B2.5070005@lsces.co.uk> <55FC45C7.9010202@gmail.com> <55FC4991.1050903@lsces.co.uk> <7872E9F4-AE19-4681-B2EF-215751AE4CBE@thesba.com> Message-ID: <55FC56F9.2070109@gmail.com> Date: Fri, 18 Sep 2015 19:24:57 +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: <7872E9F4-AE19-4681-B2EF-215751AE4CBE@thesba.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28? From: rowan.collins@gmail.com (Rowan Collins) Robert Williams wrote on 18/09/2015 18:40: > Exactly, there’s clearly a gap here. Further, enough people want it > that a few have shown up on this list, which means there are probably > many, many thousands, or even millions, of people out in the wild that > want it. The problem is that a lot of the people that think they want it, don't actually have a use for it, they just feel like it "should" exist. There are a couple of small edge cases that people have come up with during this thread where it's valid, but the vast majority of examples I've seen are simply misunderstanding what isset() does and why, or not realising that array_key_exists() and property_exists() already do the job they need. The use cases Lester and yourself have come up with are NOT evidence that isset() is broken, as many people claim. They are things which the majority of people will never need to (arguably nobody "needs" to do them, but you want to do them, so I guess that's kind of the same thing). > I’m not familiar enough with PHP’s internals to say for sure, but I > suspect it’s not terribly hard to implement (it’s just isset() without > the extra null check). So… why not? Like anything else in the > language, people don’t have to use it if they don’t want to, but it’s > good to have tools. Yes, even tools that can be abused. Sure, I'm happy with that argument - IF we come up with a name and documentation that doesn't imply this is a replacement for isset(), or validate the incorrect conception that isset() is "broken". The title of this thread refers to one such misunderstanding - the article at http://www.phpsadness.com/sad/28 waffles on a lot about empty() being a bad name, doesn't even mention isset(), and scares the user with a blob of C code, but doesn't really explain why any of this is a problem. It even says: > Some languages circumvent this issue by requiring variable declaration or giving undefined variables explicit values. Neatly, PHP does both: if you take Notices seriously, variable declaration (or at least initialisation-before-reading) is required; if you ignore them, or use isset()/empty(), it gives the undefined variable a value of Null. :) So, by all means, propose a function which searches the symbol table for a variable, but please don't call it something as generic as exists(), and please don't edit the isset() documentation to recommend its usage in any but the most unusual cases. Regards, -- Rowan Collins [IMSoP]