1--TEST--
2Test session_encode() function : variation
3--SKIPIF--
4<?php include('skipif.inc'); ?>
5--FILE--
6<?php
7
8ob_start();
9
10/*
11 * Prototype : string session_encode(void)
12 * Description : Encodes the current session data as a string
13 * Source code : ext/session/session.c
14 */
15
16echo "*** Testing session_encode() : variation ***\n";
17
18var_dump(session_start());
19$_SESSION[] = 1234567890;
20var_dump(session_encode());
21var_dump(session_destroy());
22var_dump(session_start());
23$_SESSION[1234567890] = "Hello World!";
24var_dump(session_encode());
25var_dump(session_destroy());
26var_dump(session_start());
27$_SESSION[-1234567890] = 1234567890;
28var_dump(session_encode());
29var_dump(session_destroy());
30
31echo "Done";
32ob_end_flush();
33?>
34--EXPECTF--
35*** Testing session_encode() : variation ***
36bool(true)
37
38Notice: session_encode(): Skipping numeric key 0 in %s on line %d
39bool(false)
40bool(true)
41bool(true)
42
43Notice: session_encode(): Skipping numeric key 1234567890 in %s on line %d
44bool(false)
45bool(true)
46bool(true)
47
48Notice: session_encode(): Skipping numeric key -1234567890 in %s on line %d
49bool(false)
50bool(true)
51Done
52