예제 #1
0
 function &hprose_unserialize_with_stream($s, $simple = false)
 {
     $str = $s->readfull();
     $v =& hprose_unserialize($str, $simple);
     $s->init($str);
     return $v;
 }
예제 #2
0
 public static function &unserialize($data, $simple = false)
 {
     return hprose_unserialize($data, $simple);
     // $stream = new HproseStringStream($data);
     // $hproseReader = new HproseReader($stream, $simple);
     // return $hproseReader->unserialize();
 }
예제 #3
0
 public function testReference()
 {
     $o = new Person();
     $o->name = "tom";
     $o->age = 18;
     $a = array($o, $o);
     $s = hprose_serialize($a);
     $this->assertEquals($s, 'a2{c6"Person"2{s4"name"s3"age"}o0{s3"tom"i18;}r3;}');
     $this->assertEquals(hprose_unserialize($s), $a);
 }