2000-12-24 16:01:32 +00:00
|
|
|
--TEST--
|
2002-10-03 16:14:55 +00:00
|
|
|
session object deserialization
|
2002-03-08 19:16:19 +00:00
|
|
|
--SKIPIF--
|
2002-04-19 07:55:24 +00:00
|
|
|
<?php include('skipif.inc'); ?>
|
2002-10-03 08:07:21 +00:00
|
|
|
--INI--
|
2002-10-03 15:11:01 +00:00
|
|
|
session.use_cookies=0
|
|
|
|
session.cache_limiter=
|
2002-11-25 23:20:05 +00:00
|
|
|
session.serialize_handler=php
|
2005-07-04 13:09:14 +00:00
|
|
|
session.save_handler=files
|
2000-12-24 16:01:32 +00:00
|
|
|
--FILE--
|
2001-10-06 09:54:23 +00:00
|
|
|
<?php
|
2002-10-03 16:14:55 +00:00
|
|
|
error_reporting(E_ALL);
|
2000-12-24 16:01:32 +00:00
|
|
|
|
|
|
|
class foo {
|
2003-11-30 13:57:20 +00:00
|
|
|
public $bar = "ok";
|
2000-12-24 16:01:32 +00:00
|
|
|
function method() { $this->yes++; }
|
|
|
|
}
|
|
|
|
|
2002-01-10 05:11:19 +00:00
|
|
|
session_id("abtest");
|
2000-12-24 16:01:32 +00:00
|
|
|
session_start();
|
|
|
|
session_decode('baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}}');
|
2006-03-07 00:20:54 +00:00
|
|
|
$baz = $_SESSION['baz'];
|
|
|
|
$arr = $_SESSION['arr'];
|
2000-12-24 16:01:32 +00:00
|
|
|
|
2000-12-24 16:06:32 +00:00
|
|
|
$baz->method();
|
|
|
|
$arr[3]->method();
|
|
|
|
|
2000-12-24 16:01:32 +00:00
|
|
|
var_dump($baz);
|
|
|
|
var_dump($arr);
|
|
|
|
session_destroy();
|
|
|
|
--EXPECT--
|
2003-05-31 13:10:00 +00:00
|
|
|
object(foo)#1 (2) {
|
2000-12-24 16:01:32 +00:00
|
|
|
["bar"]=>
|
|
|
|
string(2) "ok"
|
|
|
|
["yes"]=>
|
2000-12-24 16:06:32 +00:00
|
|
|
int(2)
|
2000-12-24 16:01:32 +00:00
|
|
|
}
|
|
|
|
array(1) {
|
|
|
|
[3]=>
|
2003-05-31 13:10:00 +00:00
|
|
|
object(foo)#2 (2) {
|
2000-12-24 16:01:32 +00:00
|
|
|
["bar"]=>
|
|
|
|
string(2) "ok"
|
|
|
|
["yes"]=>
|
2000-12-24 16:06:32 +00:00
|
|
|
int(2)
|
2000-12-24 16:01:32 +00:00
|
|
|
}
|
|
|
|
}
|
2006-03-27 14:08:10 +00:00
|
|
|
--UEXPECT--
|
|
|
|
object(foo)#1 (2) {
|
|
|
|
[u"bar"]=>
|
|
|
|
unicode(2) "ok"
|
|
|
|
[u"yes"]=>
|
|
|
|
int(2)
|
|
|
|
}
|
|
|
|
array(1) {
|
|
|
|
[3]=>
|
|
|
|
object(foo)#2 (2) {
|
|
|
|
[u"bar"]=>
|
|
|
|
unicode(2) "ok"
|
|
|
|
[u"yes"]=>
|
|
|
|
int(2)
|
|
|
|
}
|
|
|
|
}
|