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
18var_dump(session_id());
19var_dump(session_id("!"));
20var_dump(session_id());
21@session_start();
22@session_destroy();
23
24var_dump(session_id());
25var_dump(session_id("?><"));
26var_dump(session_id());
27@session_start();
28@session_destroy();
29
30var_dump(session_id());
31var_dump(session_id("\xa3$%^&*()"));
32var_dump(session_id());
33@session_start();
34@session_destroy();
35
36var_dump(session_id());
37var_dump(session_id("\r\n"));
38var_dump(session_id());
39@session_start();
40@session_destroy();
41
42var_dump(session_id());
43var_dump(session_id("\0"));
44var_dump(session_id());
45@session_start();
46@session_destroy();
47
48var_dump(session_id());
49var_dump(session_id("\xac``@~:{>?><,./[]+--"));
50var_dump(session_id());
51@session_start();
52@session_destroy();
53
54echo "Done";
55ob_end_flush();
56?>
57--EXPECT--
58*** Testing session_id() : error functionality ***
59string(0) ""
60string(0) ""
61string(1) "!"
62string(0) ""
63string(0) ""
64string(3) "?><"
65string(0) ""
66string(0) ""
67string(8) "�$%^&*()"
68string(0) ""
69string(0) ""
70string(2) "
71"
72string(0) ""
73string(0) ""
74string(0) ""
75string(0) ""
76string(0) ""
77string(19) "�``@~:{>?><,./[]+--"
78Done
79