xref: /PHP-5.4/ext/session/tests/001.phpt (revision 8deefa87)
1--TEST--
2session object serialization
3--SKIPIF--
4<?php include('skipif.inc'); ?>
5--INI--
6session.use_cookies=0
7session.cache_limiter=
8session.serialize_handler=php
9session.save_handler=files
10--FILE--
11<?php
12error_reporting(E_ALL);
13
14class foo {
15	public $bar = "ok";
16
17	function method() { $this->yes = "done"; }
18}
19
20$baz = new foo;
21$baz->method();
22
23$arr[3] = new foo;
24$arr[3]->method();
25
26session_start();
27
28$_SESSION["baz"] = $baz;
29$_SESSION["arr"] = $arr;
30
31print session_encode()."\n";
32
33session_destroy();
34--EXPECT--
35baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}}
36
37