Re: PHP 7.1 - Address PHPSadness #28?
| From: | Lester Caine | Date: | Wed, 16 Sep 2015 22:39:30 +0000 |
| Subject: | Re: PHP 7.1 - Address PHPSadness #28? | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-88269@lists.php.net to get a copy of this message | ||
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.
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk