1--TEST--
2Test session_name() function : variation
3--INI--
4session.save_path=
5session.name=PHPSESSID
6session.save_handler=files
7--SKIPIF--
8<?php include('skipif.inc'); ?>
9--FILE--
10<?php
11
12ob_start();
13
14echo "*** Testing session_name() : variation ***\n";
15
16var_dump(session_name("\0"));
17var_dump(session_start());
18var_dump(session_name());
19var_dump(session_destroy());
20var_dump(session_name());
21
22var_dump(session_name("\t"));
23var_dump(session_start());
24var_dump(session_name());
25var_dump(session_destroy());
26var_dump(session_name());
27
28var_dump(session_name(""));
29var_dump(session_start());
30var_dump(session_name());
31var_dump(session_destroy());
32var_dump(session_name());
33
34echo "Done";
35ob_end_flush();
36?>
37--EXPECTF--
38*** Testing session_name() : variation ***
39string(9) "PHPSESSID"
40bool(true)
41string(9) "PHPSESSID"
42bool(true)
43string(9) "PHPSESSID"
44string(9) "PHPSESSID"
45
46Warning: session_start(): session.name cannot contain any of the following '=,; \t\r\n\013\014' in %s on line %d
47bool(true)
48string(1) "	"
49bool(true)
50string(1) "	"
51
52Warning: session_name(): session.name "" cannot be numeric or empty in %s on line %d
53string(1) "	"
54
55Warning: session_start(): session.name cannot contain any of the following '=,; \t\r\n\013\014' in %s on line %d
56bool(true)
57string(1) "	"
58bool(true)
59string(1) "	"
60Done
61