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