ID:               28919
 Updated by:       [EMAIL PROTECTED]
 Reported By:      black at scene-si dot org
 Status:           Open
-Bug Type:         Scripting Engine problem
+Bug Type:         Feature/Change Request
 Operating System: any
 PHP Version:      Irrelevant
 New Comment:

This is expected behavior.  list() is a left-hand language construct
and not currently intended to be used this way.

Reclassifying to Feature/Change Request.


Previous Comments:
------------------------------------------------------------------------

[2004-06-25 13:20:05] black at scene-si dot org

Description:
------------
Requesting additional functionality for foreach?

Reproduce code:
---------------
$table = array();
$table['username'] = array(1,"John doe");
$table['black'] = array(2,"Jane doe");
$table['yawn'] = array(3,"Undefined");

foreach ($table as $key=>list($id,$title)) {
  echo $key.":".$id.", ".$title."\n";
}
foreach ($table as list($id,$title)) {
  echo $id.", ".$title."\n";
}

Expected result:
----------------
username:1, John doe
black:2, Jane doe
yawn:3, Undefined
1, John doe
2, Jane doe
3, Undefined

Actual result:
--------------
Parse error


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=28919&edit=1

Reply via email to