1--TEST--
2Test session_id() function : error functionality
3--SKIPIF--
4<?php include('skipif.inc'); ?>
5--FILE--
6<?php
7
8ob_start();
9
10/*
11 * Prototype : string session_id([string $id])
12 * Description : Get and/or set the current session id
13 * Source code : ext/session/session.c
14 */
15
16echo "*** Testing session_id() : error functionality ***\n";
17
18@session_start();
19var_dump(session_id());
20var_dump(session_id("!"));
21var_dump(session_id());
22@session_destroy();
23
24@session_start();
25var_dump(session_id());
26var_dump(session_id("?><"));
27var_dump(session_id());
28@session_destroy();
29
30@session_start();
31var_dump(session_id());
32var_dump(session_id("�$%^&*()"));
33var_dump(session_id());
34@session_destroy();
35
36@session_start();
37var_dump(session_id());
38var_dump(session_id("\r\n"));
39var_dump(session_id());
40@session_destroy();
41
42@session_start();
43var_dump(session_id());
44var_dump(session_id("\0"));
45var_dump(session_id());
46@session_destroy();
47
48@session_start();
49var_dump(session_id());
50var_dump(session_id("�``@~:{>?><,./[]+--"));
51var_dump(session_id());
52@session_destroy();
53
54echo "Done";
55ob_end_flush();
56?>
57--EXPECTF--
58*** Testing session_id() : error functionality ***
59string(%d) "%s"
60string(%d) "%s"
61string(1) "!"
62string(%d) "%s"
63string(%d) "%s"
64string(3) "?><"
65string(%d) "%s"
66string(%d) "%s"
67string(8) "�$%^&*()"
68string(%d) "%s"
69string(%d) "%s"
70string(2) "
71"
72string(%d) "%s"
73string(%d) "%s"
74string(0) ""
75string(%d) "%s"
76string(%d) "%s"
77string(19) "�``@~:{>?><,./[]+--"
78Done
79
80