Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88219 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76905 invoked from network); 15 Sep 2015 17:04:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Sep 2015 17:04:19 -0000 X-Host-Fingerprint: 83.112.237.179 AAubervilliers-652-1-230-179.w83-112.abo.wanadoo.fr Received: from [83.112.237.179] ([83.112.237.179:19886] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C2/98-28087-19F48F55 for ; Tue, 15 Sep 2015 13:04:18 -0400 To: internals@lists.php.net Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes References: Date: Tue, 15 Sep 2015 19:04:11 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable Message-ID: User-Agent: Opera Mail/1.0 (Win32) X-Posted-By: 83.112.237.179 Subject: Re: PHP 7.1 - Address PHPSadness #28? From: bensor987@neuf.fr ("Benoit Schildknecht") Bumping in (senior dev here). I think this function must be implemented. Every dev I've seen in my company use isset() as its name says it does := = "Is this variable set, whatever its value is ?". That's exactly how we u= se = it in the code. And we use "null" a lot too. For us, "null" is a value = like another. The irony is, we set a variable to "null" mostly to avoid = = "Undefined variable" notices. To explain it shortly, when we see "$var =3D= = null;", we know that it is a variable that could not be changed in the = scope. It is logical (at least for us) that "isset()" returns true when a = variable exists, even if its value is "null". I've yet to discover a = security bug in our code, but we have very sensitive applications, in = which we widely use "isset()". It could cause a lot of damages (maybe it= = already has, but haven't noticed yet), and "exists()" would prevent them= . Since we have "array_key_exists()", which is basically "exists()" for an= = array element, I don't see why "exists()" shouldn't be implemented. I = don't see the logic here. "isset()" and "empty()" wouldn't change, there couldn't any BC. Excepted= = for the userland code, in which there would already be an "exists()" = function. Regards, Le Wed, 26 Aug 2015 05:09:43 +0200, Scott Arciszewski = a =C3=A9crit: > Hi everybody, > > Would anyone be interested in adding another helper like > isset()/empty() simply called exists() which would return true if the > variable is defined in the current scope (i.e. without raising an > E_NOTICE)? > > It should be a simple change to add this function but it's too late > for 7.0 so, if there is any interest, I would respectfully put it off > until 7.1. > > Scott Arciszewski > Chief Development Officer > Paragon Initiative Enterprises -- = Utilisant le logiciel de courrier d'Opera : http://www.opera.com/mail/