From:             dayal at capital-merchant dot com
Operating system: Windows XP
PHP version:      4.3.5
PHP Bug Type:     Class/Object related
Bug description:  Object variables not being saved in session properly

Description:
------------
I have a php class Customer which has and Object variable 'Address'. The
class 'Address' in turn has an object variable 'Zip'.

Customer
   Address
      Zip


In the file 'CustomerTest.php' - 
I am creating a new Zip object and assigning this zip object to a new
Address object which in turn is assigned to a new Customer object. 

Now I am printing the instance variables of the Zip object (two String
values). After this I am assigning a new Zip object to the above 'Address
object' and again printing the instance variables of the Zip object to the
screen. As expected these values differ from the above print command.
Now I am assigning the Customer object to SESSION. Now on a different php
page using the Customer object stored in session, if I print the instance
variables of zip object, I get the OLD VALUES but not the new ones which I
have modified.

I reproduced the same code using servlets which functioned properly as
expected unlike php.

Please look into this.

 

Reproduce code:
---------------
http://198.92.233.203/temp/CustomerTest.php

Expected result:
----------------
Zip1: 333
Zip2: 444

Actual result:
--------------
Zip1: 123
Zip2: 345

-- 
Edit bug report at http://bugs.php.net/?id=28533&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28533&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28533&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28533&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28533&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28533&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28533&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28533&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28533&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28533&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28533&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28533&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28533&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28533&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28533&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28533&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28533&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28533&r=float

Reply via email to