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
14/*
15 * Prototype : string session_name([string $name])
16 * Description : Get and/or set the current session name
17 * Source code : ext/session/session.c
18 */
19
20echo "*** Testing session_name() : variation ***\n";
21
22var_dump(session_name("\0"));
23var_dump(session_start());
24var_dump(session_name());
25var_dump(session_destroy());
26var_dump(session_name());
27
28var_dump(session_name("\t"));
29var_dump(session_start());
30var_dump(session_name());
31var_dump(session_destroy());
32var_dump(session_name());
33
34var_dump(session_name(""));
35var_dump(session_start());
36var_dump(session_name());
37var_dump(session_destroy());
38var_dump(session_name());
39
40echo "Done";
41ob_end_flush();
42?>
43--EXPECTF--
44*** Testing session_name() : variation ***
45string(9) "PHPSESSID"
46bool(true)
47string(9) "PHPSESSID"
48bool(true)
49string(9) "PHPSESSID"
50string(9) "PHPSESSID"
51
52Warning: session_start(): session.name cannot contain any of the following '=,; \t\r\n\013\014' in %s on line %d
53bool(true)
54string(1) "	"
55bool(true)
56string(1) "	"
57
58Warning: session_name(): session.name cannot be a numeric or empty '' in %s on line %d
59string(1) "	"
60
61Warning: session_start(): session.name cannot contain any of the following '=,; \t\r\n\013\014' in %s on line %d
62bool(true)
63string(1) "	"
64bool(true)
65string(1) "	"
66Done
67