Compare commits

...
1 Commits
3 changed files with 0 additions and 102 deletions

No files matched your search

@@ -1,36 +0,0 @@
--TEST--
Bug #14293 (serialize() and __sleep())
--FILE--
<?php
class t
{
function t()
{
$this->a = 'hello';
}
function __sleep()
{
echo "__sleep called\n";
return array('a','b');
}
}
$t = new t();
$data = serialize($t);
echo "$data\n";
$t = unserialize($data);
var_dump($t);
?>
--EXPECTF--
__sleep called
Notice: serialize(): "b" returned as member variable from __sleep() but does not exist in %sbug14293.php on line %d
O:1:"t":2:{s:1:"a";s:5:"hello";s:1:"b";N;}
object(t)#%d (2) {
["a"]=>
string(5) "hello"
["b"]=>
NULL
}
@@ -1,27 +0,0 @@
--TEST--
Bug #27469 (serialize() objects of incomplete class)
--FILE--
<?php
$str = 'O:9:"TestClass":0:{}';
$obj = unserialize($str);
var_dump($obj);
echo serialize($obj)."\n";
var_dump($obj);
echo serialize($obj)."\n";
var_dump($obj);
?>
--EXPECT--
object(__PHP_Incomplete_Class)#1 (1) {
["__PHP_Incomplete_Class_Name"]=>
string(9) "TestClass"
}
O:9:"TestClass":0:{}
object(__PHP_Incomplete_Class)#1 (1) {
["__PHP_Incomplete_Class_Name"]=>
string(9) "TestClass"
}
O:9:"TestClass":0:{}
object(__PHP_Incomplete_Class)#1 (1) {
["__PHP_Incomplete_Class_Name"]=>
string(9) "TestClass"
}
@@ -1,39 +0,0 @@
--TEST--
Bug #28325 (Problem in serialisation of circular references)
--FILE--
<?php
class a {
public $b;
}
class b {
public $c;
}
class c {
public $d;
}
$a = new a();
$a->b = new b();
$a->b->c = new c();
$a->b->c->d = $a;
var_dump(unserialize(serialize($a)));
?>
--EXPECTF--
object(a)#%d (1) {
["b"]=>
object(b)#%d (1) {
["c"]=>
object(c)#%d (1) {
["d"]=>
object(a)#%d (1) {
["b"]=>
object(b)#%d (1) {
["c"]=>
object(c)#%d (1) {
["d"]=>
*RECURSION*
}
}
}
}
}
}