From:             liz2k dot b8 at gmail dot com
Operating system: linux
PHP version:      5.2.11
PHP Bug Type:     *Programming Data Structures
Bug description:  unserialize of references

Description:
------------
function unserialize return wrong result of reference

Reproduce code:
---------------
---
>From manual page: function.serialize
---
        $a = new stdClass;
        $a->v1 = $a;
        $a->v2 = &$a;
        
        echo serialize($a)."\n";
        
        $b = &unserialize(serialize($a));
        
        echo serialize($b);


Expected result:
----------------
O:8:"stdClass":2:{s:2:"v1";r:1;s:2:"v2";R:1;}
O:8:"stdClass":2:{s:2:"v1";r:1;s:2:"v2";R:1;}

Actual result:
--------------
O:8:"stdClass":2:{s:2:"v1";r:1;s:2:"v2";R:1;}
O:8:"stdClass":2:{s:2:"v1";R:1;s:2:"v2";R:1;}

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

Reply via email to