From:             [EMAIL PROTECTED]
Operating system: Windows NT 5.1 build 2600
PHP version:      4.2.3
PHP Bug Type:     Scripting Engine problem
Bug description:  error when combing ?: and return by reference

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;

print_r($arr);
?>

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

current result:
Array
(
    [a] => 1
    [c] => 3
)

-- 
Edit bug report at http://bugs.php.net/?id=20953&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=20953&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=20953&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=20953&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=20953&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=20953&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=20953&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=20953&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=20953&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=20953&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=20953&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20953&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=20953&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=20953&r=isapi

Reply via email to