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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php