Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88270 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71869 invoked from network); 16 Sep 2015 23:10:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Sep 2015 23:10:44 -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.176 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.176 mail-wi0-f176.google.com Received: from [209.85.212.176] ([209.85.212.176:38616] helo=mail-wi0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/D5-41443-4F6F9F55 for ; Wed, 16 Sep 2015 19:10:44 -0400 Received: by wiclk2 with SMTP id lk2so5182226wic.1 for ; Wed, 16 Sep 2015 16:10:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type:subject:from:date:to :message-id; bh=OgEhv4we6FLNrHgzp1EiOyEF+hGveuRBbMmRiIWHGjY=; b=GNybzLyAzYHOSVf9zjiuWVeffvIGOo1oo5XPdZD/PqH72ImfO0D0AVGYJg3eko4cBN fDl8jMEsXngpJNkUTkM0buWGiRZDoLV9maycI9jTclz5CB5ctX6sS06GCH/h9nf8foUz asRp8C8HNdXbSLkWm0jH2Buo6amEi1hLMUJGDALr05Oady4gnwNowmFEGYp6K8+UwIHs ISi7mHO+oTTynlOwil6ukIkh7Mhqj0joa+EIyK4ZYTMXJGmqTrbceurGJWjqCfViMTsy mBFpo0d6DG0vjcJwLbqY9Ub4zEuR1dKvnCFPoyNd961/nrxP0xUxBExF1yPJyuZhwk0u mvEg== X-Received: by 10.180.184.134 with SMTP id eu6mr1338546wic.77.1442445041515; Wed, 16 Sep 2015 16:10:41 -0700 (PDT) Received: from [192.168.0.6] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by smtp.gmail.com with ESMTPSA id ft3sm6794169wib.17.2015.09.16.16.10.40 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Sep 2015 16:10:40 -0700 (PDT) User-Agent: K-9 Mail for Android In-Reply-To: <55F9EFA2.9020908@lsces.co.uk> References: <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> <55F72CA9.2060301@gmail.com> <09369945-76FE-4E08-9C2C-15FB0577AD27@thesba.com> <55F752E7.9070801@gmail.com> <55F9B4C7.3050700@gmail.com> <440C64A2-4B4F-4AEF-ACE3-F3A6637EBAB6@thesba.com> <55F9D704.5050002@lsces.co.uk> <55F9EFA2.9020908@lsces.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Date: Thu, 17 Sep 2015 00:09:34 +0100 To: Lester Caine ,internals@lists.php.net Message-ID: <0022A1D9-DC37-4F49-B58E-FBED5AF872BA@gmail.com> Subject: Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28? From: rowan.collins@gmail.com (Rowan Collins) On 16 September 2015 23:39:30 BST, Lester Caine wrote: >On 16/09/15 22:23, Rowan Collins wrote: >>> 'exists but I don't know what >>> >as yet' is a logical state >> It is indeed. "I know it's name but it doesn't exist", however, is >generally not a valid state - if you've hard-coded the name (as is the >case with 99.9% of bare variables) then clearly you consider it to have >some existence. For this reason, PHP assumes that you meant to create >it with a null value. > >If I have a dozen objects 'hard coded', but the templating system only >needs to use a few of them for this page then only the variables that >have been created exist. Yes one would be better off scanning an >associative array and only dealing with the elements actually present >in >the array. That is better coding practice, but extract() is an equally >valid practice currently being used and that needs a different way of >handling if the elements exist. I'm still not entirely sure what it is you need to "handle". What is the behaviour that you'd put in the if(! exists ()) block? More particularly, what would you put there and not put in the if(! is_null()) block, since if they're the same, then that's what if(! isset()) does, so we're all good?