Re: learning php - problem already

From: Date: Tue, 29 Jul 2003 22:16:45 +0000
Subject: Re: learning php - problem already
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-157455@lists.php.net to get a copy of this message
* Thus wrote John W. Holmes (holmes072000@charter.net): > > and apparently list() will ignore the keys that do not have numerical > indexes. The manual says numerical indexes are required, but not what > happens when they are encounted. It looks like they are just ignored. > > list($k,$v) = array('foo'=>'one','two','three'); > > for example will give $k = 'two', and $v = 'three'. 'one' is > completely > ignored because it does not have a numerical key. > > Kind of a wierd operation that "works" without you knowing all of the > details, I guess. I had to come home and actually test some things out > before I realized these last bits. :) I vaguely remember a discussion about this on the dev list. I think it was made to be intentionally confusing. For what reason, I don't but all that matters to most is: it works.. and foreach has taken over its job anyway. Curt -- "I used to think I was indecisive, but now I'm not so sure."

« previous php.general (#157455) next »