Mantis - Quercus
Viewing Issue Advanced Details
3823 minor always 12-22-09 09:08 07-13-10 14:54
domdorn  
 
normal  
new 4.0.2  
open  
none    
none  
0003823: unserialize not compatible with php unserialize
See attached testcase.

tar zxf unserialize_testcase.tar.gz
cd unserialize_testcase
php test.php
-> nothing printed

call test.php with quercus:
/home/domdorn/work/lyrix/branches/quercus/htdocs/unserialize_testcase/test.php:7: Warning: Assertion "" failed [assert] /home/domdorn/work/lyrix/branches/quercus/htdocs/unserialize_testcase/test.php:8: Warning: Assertion "" failed [assert]
 unserialize_testcase.tar.gz [^] (4,568 bytes) 12-22-09 09:08

Notes
(0004566)
nam   
05-11-10 17:02   
Can you paste a test case here? Attachments are broken at the moment...
(0004618)
sblommers   
05-28-10 12:02   
Hi, could you paste the test case please, or email to me at sebastiaan.blommers@gmail.com?
(0004619)
sblommers   
05-28-10 16:21   
I tested this using the following code:

<?php
class foo implements Serializable {
    public $bar = "foobar";

    public function unserialize($serialized){
        $array = unserialize($serialized);
        foreach ($array as $name => $values) {
            $this->$name = $values;
        }
    }

    public function serialize(){
        return serialize(get_object_vars($this));
    }
}

$foo = new foo();
$data = serialize($foo);
echo $data;
$foo2 = unserialize($data);
echo $foo2->bar;
?>

On apache2+php5
C:3:"foo":29:{a:1:{s:3:"bar";s:6:"foobar";}}foobar
On Quercus 4.0.8-SNAPSHOT (svn 7166)
O:3:"foo":1:{s:3:"bar";s:6:"foobar";}foobar

Seems incompatible