Re: PHP 5.1

From: Date: Tue, 14 Jun 2005 09:28:49 +0000
Subject: Re: PHP 5.1
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to internals+get-16655@lists.php.net to get a copy of this message
Robert Cummings wrote:
On Tue, 2005-06-14 at 01:31, Ron Korving wrote:
Jason, you are absolutely right.. this is not about input filtering at all. It's about replacing: $x = (isset($ANY_var) ? $ANY_var : 'Default Value'); by $x = ifsetor($ANY_var, 'Default Value'); So, Robert's solution is no real solution if you ask me. But again, it would be best, if there was no ifsetor() at all, I must say I fully agree; I don't see any use in putting extra functions in the PHP namespace just because people don't want to type a couple of extra characters.
but that users would have the
power to create such a function themselves in the php code space. I have no clue how though...
Well my code has nothing to do with filtering. It's all about retrieving a default value if one is not set in response to the poster to which I replied. But yes, I was hasty with it in my eternal lack of wisdom, and of course forgot about scalars. For the record, I am indeed in favour of something that allows the choice of a value from a series of values for which some may not be set-- without the generation of not set warnings :) On that note, how comes there's a $GLOBAL array and not a $LOCAL array for vars declared in the immediate scope :) because, by definition, $LOCAL would at all times be a part of $GLOBAL. And besides, why would you ever want $LOCAL? $GLOBAL is a way to reach the global scope from the local scope. When being in global scope, you never *have* a local scope, and the other way around, when being in local scope, you can reach all variables directly anyway, so there's no use for $LOCAL. Then, expecting the response "why is there a $GLOBAL array in global scope?" you might want to say that $GLOBAL is a superglobal just because the "global" scope can be seen as a "local" scope in a broader perspective. Well... that's my view on it anyway...
Cheers, Rob.


« previous php.internals (#16655) next »