Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88449 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20908 invoked from network); 23 Sep 2015 19:05:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Sep 2015 19:05:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=derokorian@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=derokorian@gmail.com; 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: derokorian@gmail.com X-Host-Fingerprint: 209.85.212.173 mail-wi0-f173.google.com Received: from [209.85.212.173] ([209.85.212.173:38527] helo=mail-wi0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4A/01-13106-BD7F2065 for ; Wed, 23 Sep 2015 15:05:00 -0400 Received: by wiclk2 with SMTP id lk2so83354920wic.1 for ; Wed, 23 Sep 2015 12:04:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=3HvlWaZY1lTLsjvCqGL2VHeMyp4mSNRZN6+UvkrR3F0=; b=aqoyUNmKguDcQ18Fd0nhN8bPOpPZ+E4diWpzZnUPWj9hteGAG66XAZv4z90QdeMpLi GeYHJt/QhSejQ9cVU3bCQ0fe7bPkBDYRmJj2BSNk4CWgsLslX/6rOvs6p3qV0qzLmAZj hEVFBSmO9uotV61RUrfVdvGnMAsmkFCDC+duLsGqJQFgy3Lq0gor7v8OCDljemAj/rZK rM1GiWdjYcvUIJjMg214KYuSey1Eq9PpNMjIVXENPOr8zIC7FrZjY3kk7CHtY08deJG3 Rdjo0Mdpv5J+dE7btT7tkt7JINcgFgHbaP0GlcO+3/7CN9O7YEm0G8Oq1uXw5t4lmfTF fs+g== MIME-Version: 1.0 X-Received: by 10.180.106.196 with SMTP id gw4mr5856185wib.63.1443035097215; Wed, 23 Sep 2015 12:04:57 -0700 (PDT) Received: by 10.28.143.137 with HTTP; Wed, 23 Sep 2015 12:04:57 -0700 (PDT) In-Reply-To: <5602EEF8.2090500@gmail.com> References: <8C74463E-DBA2-4015-8159-0B44D973387F@craigfrancis.co.uk> <55DE0907.6040904@gmail.com> <1F615BCD-1B9B-4C51-A210-869F1AA1F6E3@craigfrancis.co.uk> <55E5EBBF.6020803@gmail.com> <0BA3A129-D356-4781-B6DE-E2B5A7924AE2@craigfrancis.co.uk> <55E6EC36.6090301@gmail.com> <9AF329EC-99A5-412D-A52B-432627A5520F@gmail.com> <6F4D91EE-B56E-4B83-B1AF-598C3F6897FC@craigfrancis.co.uk> <55F07BA4.2000204@gmail.com> <55F6B911.9080400@gmail.com> <96BE7F01-D04B-483B-B1A3-B45CED6DFCDC@craigfrancis.co.uk> <55F6F08C.1020506@gmail.com> <0BEF6D82-CB5F-49F6-A3A4-3267924A0CDA@thesba.com> <56009C96.5090504@php.net> <56013228.50504@gmail.com> <5601E01E.6080606@php.net> <56027C79.9020404@gmail.com> <5602BFB3.7090707@php.net> <5602DE27.4080500@lsces.co.uk> <5602EEF8.2090500@gmail.com> Date: Wed, 23 Sep 2015 13:04:57 -0600 Message-ID: To: Rowan Collins Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=e89a8f3baebf5e380b05206ecaf6 Subject: Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28? From: derokorian@gmail.com (Ryan Pallas) --e89a8f3baebf5e380b05206ecaf6 Content-Type: text/plain; charset=UTF-8 On Wed, Sep 23, 2015 at 12:27 PM, Rowan Collins wrote: > > > My suggestion (with which I believe Stig was agreeing) is this: > > variable_exists('foo'): yes (should be yes) > unset($foo); > variable_exists('foo'): no (should be no) > variable_exists('bar'): no (should be no) > > I dislike this because it makes refactoring harder. Just like when we rename a dynamic property, we have to search for its usage as a string (which may be stored in a variable), and then analyze if those strings warrant being changed. Of course, strings in a variable may also be created dynamically, so simply searching for the name of a property being renamed may not find you all its usages. This feels like exactly the type of thing you were trying to avoid when you suggested hasitem() since you pass it a compound variable expression ($var->prop, $var['key']) which makes refactoring easier. I would prefer seeing both take actual expressions, much like isset and empty. Basically, if variable_exists recurses then its an error and if hasitem doesn't recurse its an error. --e89a8f3baebf5e380b05206ecaf6--