php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #63744 references in list()
Submitted: 2012-12-11 18:39 UTC Modified: 2016-12-29 01:28 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: ninzya at inbox dot lv Assigned:
Status: Duplicate Package: Scripting Engine problem
PHP Version: Irrelevant OS: Any
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:
MUST BE VALID
Solve the problem:
41 - 41 = ?
Subscribe to this entry?

 
 [2012-12-11 18:39 UTC] ninzya at inbox dot lv
Description:
------------
Would be good to have a possibility to extract array elements by ref like in test 
script.

Test script:
---------------
$arr = array( 1, 2 );
list( &$first, &$second ) = $arr;

++$first;
--$second;

print_r( $arr);

Expected result:
----------------
array( 2, 1 )

Actual result:
--------------
PHP Parse error:  syntax error, unexpected '&', expecting ',' or ')' in ... on 
line 2

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-03-27 21:06 UTC] nikic@php.net
-Status: Open +Status: Duplicate
 [2016-03-27 21:06 UTC] nikic@php.net
Duplicate of bug #7930 (albeit with a different syntax suggestion).
 [2016-12-29 01:27 UTC] ajf@php.net
Actually a duplicate of #6768.
 [2016-12-29 01:28 UTC] ajf@php.net
Duplicate of bug #6768
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 10:01:30 2024 UTC