From:             gregory dot szorc at case dot edu
Operating system: Linux (multiple)
PHP version:      5.0.4
PHP Bug Type:     Class/Object related
Bug description:  Child class variable change not propogated during function 
call

Description:
------------
A method is called on an instance of a class which is derived from a chain
of derived classes, some abstract.  The method is defined in the base class
and this method alters a variable also defined in the base class.  When the
method is called, the object is unchanged.

During debugging, the variable is actually changed by the base method. 
However, this change of variable is not propogated down into the derived
classes.

When the base method is changed so that it changes another variable in the
base class, the changes are reflected after the method is called.

In summary, a function call does not produce an obvious change of
variable.  When the function is changed so it alters another variable on
top of the original, both changes are seen after the function call.

Reproduce code:
---------------
I have been unable to reproduce this code outside of the project in which
I discovered the bug.

To obtain the code, use subversion:

`svn co -r 119
http://zorro.case.edu/svn/repos/php_classes/File_iCal/trunk/ iCal`

Use might need to add the created directory to the PHP include path for
the code to run.

Read File/iCal/BaseComponent.php at line 234 for info on how to
reproduce.



Expected result:
----------------
A variable gets changed via function call.

Actual result:
--------------
The variable appears left unchanged unless the function definition itself
is changed so that the object is further modified.

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

Reply via email to