|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #6268 ternary op return only by value
Submitted: 2000-08-20 21:06 UTC Modified: 2014-10-12 14:22 UTC
Avg. Score:2.3 ± 0.9
Reproduced:0 of 0 (0.0%)
From: Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: 4.0 Latest CVS (20/08/2000) OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2000-08-20 21:06 UTC]
don?t know if it?s possible to change nor if it?s needed - just noticed that it?s not possible... I think ternary returns values and not references only, don?t know a solution other than maybe a ?& b:c
all other functions can return references, ? can?t, although it is an operator, it is used function-like

echo $x =& $test ?	$test2:$test3;
echo $x;
echo $test3;


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-19 00:07 UTC]
-Package: Feature/Change Request +Package: Scripting Engine problem
 [2014-10-12 14:22 UTC]
-Status: Open +Status: Wont fix
 [2014-10-12 14:22 UTC]
Closing as this is by-design. Ternary is an expression so it returns values.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Oct 23 07:03:32 2021 UTC