Reply to Re: multidimensional array declaration in php

Your name:

Reply:


Posted by Chung Leong on 07/17/06 22:04

Bent Stigsen wrote:
> 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.

Part of the reason is the way the global and static keyword was
implemented. These are operators, not declarations. When you use them
on variables they create entries in the current symbol table. Thus if
isset() behaves as you described, it'll always return true in the
following:

<?

function bobo() {
static $the_clown;
if(isset($the_clown)) {
}
}

?>

which wouldn't be rather unintuitive, since you never actually set the
variable.

[Back to original 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

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