From:             ken dot shin at ifrance dot com
Operating system: win2000
PHP version:      5CVS-2003-12-30 (dev)
PHP Bug Type:     *General Issues
Bug description:  using unserialize in a class on the object itself

Description:
------------
well,

when i try to use unserialize in a class on the object itself,
that's return me an empty object, all property are set to NULL.

the code below work well with php4, but doesn't with php5.

Reproduce code:
---------------
<?php
class a {
    var $x;  
    function unS($serial) {
        $this = unserialize($serial);
    }
}

$test1 = new a;
$test1 -> x = 'blabla';
var_dump($test1);

$serial = serialize ($test1);
var_dump($serial);

$test2 = new a;
$test2->unS($serial);
//$test2 = unserialize($serial);
var_dump($test2);
?>

Expected result:
----------------
i expected the same behaviour as in php4. php5 return me the right result
when i use unserialize out of the class but return me an empty object when
i use it in the class.

actual result
-------------------------
object(a)#2 (1) {
  ["x"]=>
  NULL
}


expected result
-------------------------
object(a)#2 (1) {
  ["x"]=>
  string(7) "blabla"
}


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

Reply via email to