~ubuntu-branches/ubuntu/hardy/php5/hardy-updates

« back to all changes in this revision

Viewing changes to ext/session/tests/003.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-10-09 03:14:32 UTC
  • Revision ID: james.westby@ubuntu.com-20051009031432-kspik3lobxstafv9
Tags: upstream-5.0.5
ImportĀ upstreamĀ versionĀ 5.0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
session object deserialization
 
3
--SKIPIF--
 
4
<?php include('skipif.inc'); ?>
 
5
--INI--
 
6
session.use_cookies=0
 
7
session.cache_limiter=
 
8
register_globals=1
 
9
session.serialize_handler=php
 
10
--FILE--
 
11
<?php
 
12
error_reporting(E_ALL);
 
13
 
 
14
class foo {
 
15
        public $bar = "ok";
 
16
        function method() { $this->yes++; }
 
17
}
 
18
 
 
19
session_id("abtest");
 
20
session_start();
 
21
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;}}');
 
22
 
 
23
$baz->method();
 
24
$arr[3]->method();
 
25
 
 
26
var_dump($baz);
 
27
var_dump($arr);
 
28
session_destroy();
 
29
--EXPECT--
 
30
object(foo)#1 (2) {
 
31
  ["bar"]=>
 
32
  string(2) "ok"
 
33
  ["yes"]=>
 
34
  int(2)
 
35
}
 
36
array(1) {
 
37
  [3]=>
 
38
  object(foo)#2 (2) {
 
39
    ["bar"]=>
 
40
    string(2) "ok"
 
41
    ["yes"]=>
 
42
    int(2)
 
43
  }
 
44
}