ID:               46192
 Updated by:       [EMAIL PROTECTED]
 Reported By:      s dot tretter at szene1 dot at
-Status:           Open
+Status:           Assigned
 Bug Type:         SPL related
 Operating System: Linux
 PHP Version:      5.3.0alpha2
-Assigned To:      
+Assigned To:      colder


Previous Comments:
------------------------------------------------------------------------

[2008-09-28 10:40:42] s dot tretter at szene1 dot at

Description:
------------
A ArrayObject containing a second ArrayObject cannot be unserialized.
The serialization differs from php5.2 to php5.3:
php5.3
C:11:"ArrayObject":180:{
        x:i:0;C:11:"ArrayObject":140:{
                x:i:0;a:5:{
                        s:4:"date";i:1222539347;
                        s:7:"session";s:13:"geF9ndWVzdF8w";
                        s:5:"style";i:1;
                        s:7:"friends";i:0;
                        s:12:"friends_list";a:0:{}
                };
                m:a:0:{}
        };
        m:a:0:{}}

php5.2
O:11:"ArrayObject":5:{
        s:4:"date";i:1222539347;
        s:7:"session";s:13:"geF9ndWVzdF8w";
        s:5:"style";i:1;
        s:7:"friends";
        i:0;s:12:"friends_list";a:0:{}
}


Reproduce code:
---------------
$useronline = new ArrayObject(
        new ArrayObject(
        array('date'=>1222539347,
                'session'=>'geF9ndWVzdF8w',
                'style'=>1,
                'friends'=>0,
                'friends_list'=>array()
                )
        )
        );

print_r($useronline);echo "\n";

$r = serialize($useronline);
echo $r."\n";

print_r(unserialize($r));

Expected result:
----------------
should work like in php 5.2

Actual result:
--------------
Fatal error: Uncaught exception 'UnexpectedValueException' with message
'Error at offset 6 of 180 bytes' in test.php:18
Stack trace:
#0 [internal function]: ArrayObject->unserialize('x:i:0;C:11:"Arr...')
#1 test.php(18): unserialize('C:11:"ArrayObje...')
#2 {main}
  thrown in test.php on line 18



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=46192&edit=1

Reply via email to