|
Posted by Bent Stigsen on 07/17/06 20:44
Jerry Stuckle wrote:
> Bent Stigsen wrote:
[snip]
>> I don't know if I is incorrect use that flavours my opinion. Hardly a
>> way to solve the lack of speed. It just isn't for number crunching.
>> Scope-rules usually annoys me. Behavior of isset bugs me.
>> This bugs me:
>> $a = array(1,2,3);
>> foreach($a as &$val) $val = $val * 2;
>> foreach($a as $key=>$val) echo "$key = $val\n";
>> Returns:
>> 0 = 2
>> 1 = 4
>> 2 = 4
>> Behavior by design, no problem, but I hate when I have to read the
>> fine print in the manual, if I on top of that find it illogical, then
>> it is a stinking pile of cow dung.
>
> What's illogical about it? In order to get a value out of a variable,
> you need to have put a value into that variable. Nothing illogical there.
echo $a; // Notice generated: "Notice: Undefined variable: a in ..."
$a = null;
echo $a; // No notice is generated
This makes good sense to me, since I did define it to "something",
whatever the concept of null is.
When it comes to "being set", I don't find it particularly neat. It
lacks symmetry.
If "isset" returns true, then "unset" has an effect on the system, but
if "isset" returns false, well then "unset" might have an effect, it
depends.
Not a problem, just ugly in my opinion.
--
/Bent
Navigation:
[Reply to this message]
|