From:             
Operating system: Windows XP Home SP3
PHP version:      5.2.13
Package:          Class/Object related
Bug Type:         Bug
Bug description:Static Member Reference Not Updating

Description:
------------
When an object's member is assigned as a reference to a different class'
static member and that static member is itself later assigned by reference,
the original object member's reference is not being updated.





I posted this question to the PHP General Mailing List.  One user confirmed
the bug for V5.0.0 to V5.3.3RC2.  In case you would like to search the
archive, the subject of the email was "Static Class Member References".

Test script:
---------------
<?php

class A

{

  public static $a = 3;

}



class B 

{

        public $b;



        public function assign()

        {

                $this->b =& A::$a;

        }

}



$b = new B;

$a = new A;

$b->assign();

A::$a =& $a;



var_dump($b->b); // expected: object(A) | result: int 3

?>

Expected result:
----------------
I expect 'var_dump($b->b);'  to print: object(A).

Actual result:
--------------
'var_dump($b->b);' is actually printing 'int 3'.

-- 
Edit bug report at http://bugs.php.net/bug.php?id=52332&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=52332&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=52332&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=52332&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=52332&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=52332&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=52332&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=52332&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=52332&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=52332&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=52332&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=52332&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=52332&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=52332&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=52332&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=52332&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=52332&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=52332&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=52332&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=52332&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=52332&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=52332&r=mysqlcfg

Reply via email to