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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ninzya at inbox dot lv
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Sat Nov 23 14:01:29 2024 UTC