1--TEST--
2Test session_save_path() function : variation
3--INI--
4session.gc_probability=0
5session.save_path=
6session.name=PHPSESSID
7session.save_handler=files
8--SKIPIF--
9<?php include('skipif.inc'); ?>
10--FILE--
11<?php
12
13ob_start();
14
15/*
16 * Prototype : string session_save_path([string $path])
17 * Description : Get and/or set the current session save path
18 * Source code : ext/session/session.c
19 */
20
21echo "*** Testing session_save_path() : variation ***\n";
22
23$directory = __DIR__;
24var_dump(session_save_path());
25var_dump(session_save_path($directory));
26var_dump(session_save_path());
27
28var_dump(session_start());
29var_dump(session_save_path());
30var_dump(session_save_path($directory));
31var_dump(session_save_path());
32var_dump(session_destroy());
33
34var_dump(session_save_path());
35
36echo "Done";
37ob_end_flush();
38?>
39--EXPECTF--
40*** Testing session_save_path() : variation ***
41string(0) ""
42string(0) ""
43string(%d) "%stests"
44bool(true)
45string(%d) "%stests"
46
47Warning: session_save_path(): Cannot change save path when session is active in %s on line 20
48bool(false)
49string(%d) "%stests"
50bool(true)
51string(%d) "%stests"
52Done
53