1--TEST--
2Test session_decode() function : variation
3--SKIPIF--
4<?php include('skipif.inc'); ?>
5--FILE--
6<?php
7
8ob_start();
9
10echo "*** Testing session_decode() : variation ***\n";
11
12var_dump(session_start());
13var_dump($_SESSION);
14$_SESSION["foo"] = 1234567890;
15$_SESSION["bar"] = "Blah!";
16$_SESSION["guff"] = 123.456;
17var_dump($_SESSION);
18$encoded = "A2Zvb2k6MTIzNDU2Nzg5MDs=";
19var_dump(session_decode(base64_decode($encoded)));
20var_dump($_SESSION);
21var_dump(session_destroy());
22
23echo "Done";
24ob_end_flush();
25?>
26--EXPECTF--
27*** Testing session_decode() : variation ***
28bool(true)
29array(0) {
30}
31array(3) {
32  ["foo"]=>
33  int(1234567890)
34  ["bar"]=>
35  string(5) "Blah!"
36  ["guff"]=>
37  float(123.456)
38}
39
40Warning: session_decode(): Failed to decode session object. Session has been destroyed in %s on line %d
41bool(false)
42array(0) {
43}
44
45Warning: session_destroy(): Trying to destroy uninitialized session in %s on line %d
46bool(false)
47Done
48