1--TEST--
2Test session_create_id() function : basic functionality
3--INI--
4session.save_handler=files
5session.sid_length=32
6--EXTENSIONS--
7session
8--SKIPIF--
9<?php include('skipif.inc'); ?>
10--FILE--
11<?php
12
13ob_start();
14
15echo "*** Testing session_create_id() : basic functionality ***\n";
16
17// No session
18var_dump(session_create_id());
19var_dump(session_create_id('ABCD'));
20
21ini_set('session.use_strict_mode', true);
22$sid = session_create_id('XYZ');
23var_dump($sid);
24var_dump(session_id($sid));
25session_start();
26var_dump(session_id());
27var_dump(session_id() === $sid);
28session_destroy();
29
30ini_set('session.use_strict_mode', false);
31$sid = session_create_id('XYZ');
32var_dump($sid);
33var_dump(session_id($sid));
34session_start();
35var_dump(session_id());
36var_dump(session_id() === $sid);
37session_destroy();
38
39echo "Done";
40ob_end_flush();
41?>
42--EXPECTF--
43*** Testing session_create_id() : basic functionality ***
44string(32) "%s"
45string(36) "ABCD%s"
46string(35) "XYZ%s"
47string(0) ""
48string(32) "%s"
49bool(false)
50string(35) "XYZ%s"
51string(0) ""
52string(35) "XYZ%s"
53bool(true)
54Done
55