From: brightone at o2 dot pl
Operating system: windows xp
PHP version: 4.3.4
PHP Bug Type: Class/Object related
Bug description: initializing class in other class vars value problem
Description:
------------
You have two classes, one initialized in another's contructor. After
initializing the "child" class in "mother" constructor, all new values
assigned to variables in mother are not visible in pointed classes.
Reproduce code:
---------------
<? class a{
var $temp;
var $pointer;
function a(){
$this->temp=10;
$this->pointer=new b(&$this);
$this->temp=20;
echo " A: ".$this->temp;
}
}
class b{
var $root;
function b($root){
$this->root=$root;
}
function show_val(){
echo " B: ".$this->root->temp;
}
}
$r=new a;
$r->pointer->show_val(); ?>
Expected result:
----------------
A: 20 B: 20
Actual result:
--------------
A: 20 B: 10
--
Edit bug report at http://bugs.php.net/?id=26364&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26364&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26364&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=26364&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=26364&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=26364&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=26364&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=26364&r=support
Expected behavior: http://bugs.php.net/fix.php?id=26364&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=26364&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=26364&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=26364&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26364&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=26364&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=26364&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=26364&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26364&r=float