#45145 [NEW]: reference aliasing is working backwards, wiping the var
| From: | phpbug at thoria dot org | Date: | Sun, 01 Jun 2008 14:35:38 +0000 |
| Subject: | #45145 [NEW]: reference aliasing is working backwards, wiping the var | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-125410@lists.php.net to get a copy of this message | ||
From: phpbug at thoria dot org
Operating system: Linux
PHP version: 5.2CVS-2008-06-01 (snap)
PHP Bug Type: Variables related
Bug description: reference aliasing is working backwards, wiping the var
Description:
------------
On versions 5.2.3 and 4.3.1(Zend off), on different shared hosting
servers.
Within one large function/loop in my app
$x = &$y;
y is destroyed and replaced by x, intermittently. unset($x) is ignored if
placed above it, and x still goes into y. There is no workaround, besides
using $x = $y. I think any ref assignments in this loop behave like this if
$x has had a prior value.
You will need to have my whole app installed. It's so weird, it makes me
feel dumb to submit it.
Reproduce code:
---------------
$bb = "original string";
$aa = "moo";
unset($aa);
$aa = &$bb;
echo "AA->$aa, BB->$bb <br>";
or
$bb = "original string";
$aa = "moo";
$aa = &$bb;
echo "AA->$aa, BB->$bb <br>";
The following is OK
$aa = "moo";
$bb = "original string";
$aa = &$bb;
echo "AA->$aa, BB->$bb <br>";
Expected result:
----------------
AA->original string, BB->original string
AA->original string, BB->original string
AA->original string, BB->original string
Actual result:
--------------
AA->original string, BB->original string
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->original string, BB->original string
AA->moo, BB->moo
AA->moo, BB->moo
AA->original string, BB->original string
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->moo, BB->moo
AA->original string, BB->original string
AA->moo, BB->
--
Edit bug report at http://bugs.php.net/?id=45145&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45145&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45145&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45145&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45145&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=45145&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45145&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45145&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45145&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45145&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45145&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=45145&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=45145&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45145&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45145&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45145&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45145&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45145&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45145&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45145&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45145&r=mysqlcfg