コード例 #1
0
ファイル: serialize.php プロジェクト: jenalgit/roadsend-php
        echo "yay i woke up!!!\n";
    }
}
$a = array('one', 'two', 'three');
test_ser($a);
$a = array('one' => 'nine', 'two' => 'seven', 'three' => 'twelve');
test_ser($a);
$a = array('one' => 'nine', 'two', array(1 => 'six'));
test_ser($a);
$a = array('one' => 'nine', 'two', array(1 => 'six', array(4, 2, 1)), '2');
test_ser($a);
test_ser(true);
test_ser(false);
test_ser("this is a test of a string with \"; some a:0 N; shit in it i:23123; to screw tim up b:0; on the unserializer");
test_ser(2371238);
test_ser(23.2312);
test_ser(23.123456789012344);
test_ser(NULL);
$c = new myClass();
test_ser($c);
$d = new myClass();
$sd = serialize($d);
echo $sd;
$e = unserialize($sd);
$e->hello();
$d = new myClass2();
$sd = serialize($d);
echo $sd;
$e = unserialize($sd);
print_r($e);
$e->hello();
コード例 #2
0
        echo "yay i woke up!!!\n";
    }
}
class zot
{
    var $prop = array(1, 2, array("hah" => 'yoles'));
}
$a = array('one' => 'nine', 'string' => 'two', array(1 => 'six', array(4, 2, 1)), '2');
//$a[] =& $a;
$a[] =& $globa;
$a[] = 'breaker';
$a[] = $a;
$a[] = $globa;
$a['luck'] =& $globa;
$b = test_ser($a);
// test ref assignment from unserialized array
$b['luck'] = 'new val';
print_r($b);
$sing =& $globa;
$b = test_ser($sing);
$a = array('my global hi there', $globa, &$globa, 'nonref' => $globa, 'ref' => &$globa);
$a[] =& $globa;
test_ser($a);
$c = new myClass();
$c->multi();
$d = test_ser($c);
$d->p6 = 'new val';
print_r($d);
$a = array('hi', &$a);
test_ser($a);