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("test"));
19var_dump(session_id());
20var_dump(session_id("1234567890"));
21var_dump(session_id());
22var_dump(session_start());
23var_dump(session_id("1234567890"));
24var_dump(session_destroy());
25var_dump(session_id());
26
27echo "Done";
28ob_end_flush();
29?>
30--EXPECTF--
31*** Testing session_id() : error functionality ***
32string(0) ""
33string(4) "test"
34string(4) "test"
35string(10) "1234567890"
36bool(true)
37
38Warning: session_id(): Cannot change session id when session is active in %s on line %d
39bool(false)
40bool(true)
41string(0) ""
42Done
43