You are here: Re: multidimensional array declaration in php « PHP Programming Language « IT news, forums, messages
Re: multidimensional array declaration in php

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация