|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20953 error when combing ?: and return by reference
Submitted: 2002-12-12 04:29 UTC Modified: 2003-01-02 18:46 UTC
Avg. Score:4.6 ± 0.7
Reproduced:9 of 9 (100.0%)
Same Version:4 (44.4%)
Same OS:4 (44.4%)
From: minakov at bas-net dot by Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 4.4.0-dev OS: Windows NT 5.1 build 2600
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.
Bug Type:
From: minakov at bas-net dot by
New email:
PHP Version: OS:


 [2002-12-12 04:29 UTC] minakov at bas-net dot by
let the sample code say the problem

function &Ref_Bad(&$arr) { return true ? $arr : $arr; }
function &Ref_Good(&$arr) { if (true) return $arr; else return $arr; }

$arr = array('a' => '1');

$arr_bad =& Ref_Bad($arr);
$arr_good =& Ref_Good($arr);

$arr_bad['b'] = 2;
$arr_good['c'] = 3;


required result:
    [a] => 1
    [b] => 2
    [c] => 3

current result:
    [a] => 1
    [c] => 3


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-12 05:52 UTC]
Please try using this CVS snapshot:
For Windows:
 [2002-12-12 09:11 UTC] minakov at bas-net dot by
I tried it - it does not work as well.
 [2002-12-12 11:19 UTC]
Just curious..exactly what practical use has this??
Could you give us some real world example instead..?

 [2003-01-02 18:46 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Feb 03 01:03:42 2023 UTC