|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
42 + 36 = ?
Subscribe to this entry?

 [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: Thu Feb 25 05:01:23 2021 UTC