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

Posted by Jerry Stuckle on 07/17/06 14:59

Bent Stigsen wrote:
> Tony Marston wrote:
>
>>
>> You can put a value into a variable without having to define the
>> variable beforehand. If you attempt to read from a variable that does
>> not yet exist then a ntice is generated. What's so difficult about that?
>
>
> It's quite clearly stated in the manual, no problem there. I just don't
> understand the choice of behavior.
>
> It is the concept of "isset", which I like to take literally.
> When I set the variable to null, causing the variable to appear in
> $GLOBALS, why should "isset" return false?
>
> I understand the behavior, not the choice.
>

Because null is not a value. It is specifically the *lack of a value*.
Therefore, the variable does not contain a value - it is not set.

>
> 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.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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