|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #66000 Unpacking nested arrays with list
Submitted: 2013-10-30 11:57 UTC Modified: 2013-10-31 18:14 UTC
From: info at pkrules dot in Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.4.21 OS: windows 8 pro
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: info at pkrules dot in
New email:
PHP Version: OS:


 [2013-10-30 11:57 UTC] info at pkrules dot in
From manual page:


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:
$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:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-30 12:17 UTC] gabri dot ns at gmail dot com
"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.
 [2013-10-31 18:14 UTC]
-Status: Open +Status: Not a bug
 [2013-10-31 18:14 UTC]
As noticed by the author; not a bug.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Sep 25 00:03:42 2021 UTC