1--TEST--
2Test basic function : variation2
3--INI--
4session.use_strict_mode=1
5session.save_handler=files
6session.hash_bits_per_character=4
7session.gc_probability=1
8session.gc_divisor=1000
9session.gc_maxlifetime=300
10session.save_path=
11session.sid_length=32
12session.name=PHPSESSID
13--SKIPIF--
14<?php include('skipif.inc'); ?>
15--FILE--
16<?php
17
18ob_start();
19
20/*
21 * Prototype : session.use_strict_mode=1
22 * Description : Test basic functionality.
23 * Source code : ext/session/session.c, ext/session/mod_files.c
24 */
25
26echo "*** Testing basic session functionality : variation2 ***\n";
27
28$session_id = 'testid';
29session_id($session_id);
30$path = __DIR__;
31var_dump(session_save_path($path));
32
33echo "*** Without lazy_write ***\n";
34var_dump(session_id($session_id));
35var_dump(session_start(['lazy_write'=>FALSE]));
36$session_id_new1 = session_id();
37var_dump($session_id_new1 !== $session_id);
38var_dump(session_write_close());
39var_dump(session_id());
40
41echo "*** With lazy_write ***\n";
42var_dump(session_id($session_id));
43var_dump(session_start(['lazy_write'=>TRUE]));
44$session_id_new2 = session_id();
45var_dump($session_id_new1 !== $session_id_new2);
46var_dump(session_commit());
47var_dump(session_id());
48
49echo "*** Cleanup ***\n";
50ini_set('session.use_strict_mode',0);
51var_dump(session_id($session_id_new1));
52var_dump(session_start());
53var_dump(session_destroy());
54var_dump(session_id($session_id_new2));
55var_dump(session_start());
56var_dump(session_destroy());
57
58ob_end_flush();
59?>
60--EXPECTF--
61*** Testing basic session functionality : variation2 ***
62string(0) ""
63*** Without lazy_write ***
64string(6) "testid"
65bool(true)
66bool(true)
67bool(true)
68string(32) "%s"
69*** With lazy_write ***
70string(32) "%s"
71bool(true)
72bool(true)
73bool(true)
74string(32) "%s"
75*** Cleanup ***
76string(32) "%s"
77bool(true)
78bool(true)
79string(0) ""
80bool(true)
81bool(true)
82