|
Posted by Chung Leong on 07/18/06 16:37
Bent Stigsen wrote:
> It is not that I in a tight spot haven't made that kind of choice of
> getting a feature at the cost of a less sensible behavior, in order to
> avoid the need to rewrite a lot of code. But personally I would rather
> just (temporarily) accept the odd effect of the modifiers, rather than
> seeing other functions being adapted to it, if that is the case.
We're not looking at just a couple similiar of odd cases though.
Similiar logic pervades the language engine. Uninitialized object
properties for example. Or when you make a reference to an array
element that doesn't yet exist. Basically anytime PHP needs a blank
placeholder it sets it to null. In order to make isset() sematically
correct, you'd have to either create a new "uninitialized" type or make
null a dual-state type. Since the difference is so slight, it's really
hard to do.
The way I see it, isset()'s raison d'etre is register_globals. That's
the only sensible scenario where a programmer cannot control whether a
variable exists or not. Since register_globals is deprecated, isset()
is sort of obsolete.
[Back to original message]
|