Doc #66000 [Com]: Unpacking nested arrays with list
| From: | gabri dot ns at gmail dot com | Date: | Wed, 30 Oct 2013 12:17:57 +0000 |
| Subject: | Doc #66000 [Com]: Unpacking nested arrays with list | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-10565@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66000&edit=1
ID: 66000
Comment by: gabri dot ns at gmail dot com
Reported by: info at pkrules dot in
Summary: Unpacking nested arrays with list
Status: Open
Type: Documentation Problem
Package: Documentation problem
Operating System: windows 8 pro
PHP Version: 5.4.21
Block user comment: N
Private report: N
New Comment:
"PHP 5.5 added the ability..."
the documentation already stated that.
so it is the right response since you using 5.4.7
this is not a bug.
Previous Comments:
------------------------------------------------------------------------
[2013-10-30 11:57:54] info at pkrules dot in
Description:
------------
---
From manual page: http://www.php.net/control-structures.foreach
---
The
Unpacking nested arrays with list() is not working showing Parse error: syntax error, unexpected
'list' (T_LIST) in line...PHP Version 5.4.7
Test script:
---------------
<?php
$array = [
[1, 2],
[3, 4],
];
foreach ($array as list($a, $b, $c)) {
echo "A: $a; B: $b; C: $c\n";
}
?>
Expected result:
----------------
elements as output
Actual result:
--------------
error
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66000&edit=1