Edit report at https://bugs.php.net/bug.php?id=6268&edit=1
ID: 6268
Updated by: nikic@php.net
Reported by: waldschrott@php.net
Summary: ternary op return only by value
-Status: Open
+Status: Wont fix
Type: Feature/Change Request
Package: Scripting Engine problem
Operating System: *
PHP Version: 4.0 Latest CVS (20/08/2000)
Block user comment: N
Private report: N
New Comment:
Closing as this is by-design. Ternary is an expression so it returns values.
Previous Comments:
------------------------------------------------------------------------
[2000-08-20 21:06:21] waldschrott@php.net
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
<?php
$test1=1;
$test2=2;
$test3=3;
echo $x =& $test ? $test2:$test3;
echo $x;
$x=5;
echo $test3;
?>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=6268&edit=1