1--TEST--
2Test session_save_path() function : variation
3--SKIPIF--
4<?php include('skipif.inc');?>
5--INI--
6open_basedir=.
7session.save_handler=files
8session.save_path=
9session.name=PHPSESSID
10--FILE--
11<?php
12
13ob_start();
14
15echo "*** Testing session_save_path() : variation ***\n";
16$initdir = __DIR__;
17$sessions = ($initdir."/sessions");
18
19chdir($initdir);
20
21// Delete the existing directory
22if (file_exists($sessions) === TRUE) {
23    @rmdir($sessions);
24}
25
26var_dump(mkdir($sessions));
27var_dump(chdir($sessions));
28ini_set("session.save_path", $initdir);
29var_dump(session_save_path());
30var_dump(session_start());
31var_dump(session_save_path());
32var_dump(session_destroy());
33var_dump(session_save_path());
34
35echo "Done";
36ob_end_flush();
37?>
38--CLEAN--
39<?php
40$initdir = __DIR__;
41$sessions = ($initdir."/sessions");
42var_dump(rmdir($sessions));
43?>
44--EXPECTF--
45*** Testing session_save_path() : variation ***
46bool(true)
47bool(true)
48
49Warning: ini_set(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line %d
50string(0) ""
51
52Warning: session_start(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line %d
53
54Warning: session_start(): Failed to initialize storage module: files (path: ) in %s on line %d
55bool(false)
56string(0) ""
57
58Warning: session_destroy(): Trying to destroy uninitialized session in %s on line %d
59bool(false)
60string(0) ""
61Done
62