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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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

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 02:01:28 2024 UTC