#35715 [NEW]: Incompatibility in reference handling

From: Date: Fri, 16 Dec 2005 20:41:37 +0000
Subject: #35715 [NEW]: Incompatibility in reference handling
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-90578@lists.php.net to get a copy of this message
From:             messju at lammfellpuschen dot de
Operating system: 
PHP version:      5CVS-2005-12-16 (CVS)
PHP Bug Type:     Scripting Engine problem
Bug description:  Incompatibility in reference handling

Description:
------------
When an assingment is passed as a function argument that is expected to be
passed by reference, an E_STRICT message is thrown: "<b>Strict
Standards</b>:  Only variables should be passed by reference" and the
reference is lost.

This was not the case in 5.1.1


Reproduce code:
---------------
function foo(&$a) {
    $a = 1;
}

foo($a = 0);
var_dump($a);


Expected result:
----------------
int(1)

Actual result:
--------------
int(0)

-- 
Edit bug report at http://bugs.php.net/?id=35715&edit=1
-- 
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=35715&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=35715&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=35715&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=35715&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=35715&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=35715&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=35715&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=35715&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=35715&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=35715&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=35715&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=35715&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=35715&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=35715&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=35715&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=35715&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=35715&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=35715&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=35715&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=35715&r=mysqlcfg


Thread (2 messages)

« previous php.bugs (#90578) next »