ID: 27481
Updated by: [EMAIL PROTECTED]
Reported By: juergen at henge-ernst dot de
-Status: Open
+Status: Verified
Bug Type: Scripting Engine problem
Operating System: linux
PHP Version: 4.3.5RC3
-Assigned To:
+Assigned To: andi
New Comment:
Verified, but works in PHP 5.0dev (and beta4).
Previous Comments:
------------------------------------------------------------------------
[2004-03-03 08:16:05] juergen at henge-ernst dot de
Description:
------------
I tried the following with the lastest snapshot
php4-STABLE-200403031030/sapi/cli/php
just did a ./configure without an options
when using double references (accidently or not) the variables in PHP
get corrupted.
$acl contains the content of $y
If you change the line
$y = 'TestString';
to
#$y = 'TestString';
or add an var_dump($acl) before that line
everything works as expected (including the call to the undefined
function of that object). It looks like an internal pointer is not
reseted correctly
previous version sometimes crashed wich seems no longer to be the
case.
Reproduce code:
---------------
class TestObj {
var $x;
function &save() {
return $this;
}
}
$acl = new TestObj();
$acl = &$acl->save();
$y = 'TestString';
var_dump($acl);
if (is_object($acl)) {
$acl->dump();
}
Expected result:
----------------
object(testobj)(0) {
}
Actual result:
--------------
string(10) "TestString"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27481&edit=1