1--TEST--
2Test session_decode() function : basic functionality
3--SKIPIF--
4<?php include('skipif.inc'); ?>
5--FILE--
6<?php
7
8ob_start();
9
10/*
11 * Prototype : string session_decode(void)
12 * Description : Decodes session data from a string
13 * Source code : ext/session/session.c
14 */
15
16echo "*** Testing session_decode() : variation ***\n";
17
18var_dump(session_start());
19var_dump($_SESSION);
20$_SESSION["foo"] = 1234567890;
21$_SESSION["bar"] = "Hello World!";
22$_SESSION["guff"] = 123.456;
23var_dump($_SESSION);
24var_dump(session_decode("foo|a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}guff|R:1;blah|R:1;"));
25var_dump($_SESSION);
26var_dump(session_destroy());
27
28echo "Done";
29ob_end_flush();
30?>
31--EXPECTF--
32*** Testing session_decode() : variation ***
33bool(true)
34array(0) {
35}
36array(3) {
37  ["foo"]=>
38  int(1234567890)
39  ["bar"]=>
40  string(12) "Hello World!"
41  ["guff"]=>
42  float(123.456)
43}
44bool(true)
45array(4) {
46  ["foo"]=>
47  &array(3) {
48    [0]=>
49    int(1)
50    [1]=>
51    int(2)
52    [2]=>
53    int(3)
54  }
55  ["bar"]=>
56  string(12) "Hello World!"
57  ["guff"]=>
58  &array(3) {
59    [0]=>
60    int(1)
61    [1]=>
62    int(2)
63    [2]=>
64    int(3)
65  }
66  ["blah"]=>
67  &array(3) {
68    [0]=>
69    int(1)
70    [1]=>
71    int(2)
72    [2]=>
73    int(3)
74  }
75}
76bool(true)
77Done
78