Bug #12257 Updated: list() can't handle associative arrays
| From: | philip@php.net | Date: | Thu, 28 Mar 2002 02:24:42 +0000 |
| Subject: | Bug #12257 Updated: list() can't handle associative arrays | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-3540@lists.php.net to get a copy of this message | ||
ID: 12257
Updated by: philip@php.net
Reported By: daniel_sevcik@hotmail.com
Status: Open
Bug Type: Feature/Change Request
Operating System: W2000, Debian
PHP Version: 4.0.6
New Comment:
This is now documented as a <note>.
A good feature request is to have list work on associative arrays,
which would also mean it won't rely on perfect 0,1,2... order either.
Imho this is a .5 bug and .5 feature request. Could someone explain
why the current behavoir exists? See also the user notes under list().
Previous Comments:
------------------------------------------------------------------------
[2001-08-31 10:23:35] sander@php.net
List() can't handle associative arrays. Moved to feature request.
------------------------------------------------------------------------
[2001-07-19 11:40:26] daniel_sevcik@hotmail.com
<?php
$tmp=array(0=>1, "test"=>2);
list($xx,$yy)=$tmp;
echo("$xx, $yy");
?>
---Output:start---
1,
---Output:end-----
Variable $yy is empty (only if key name is not integer).
$tmp=array(0=>1, 1=>2);
In this case - it works...
Danny
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=12257&edit=1