xref: /PHP-8.1/ext/session/tests/bug74514.phpt (revision b5a14e6c)
1--TEST--
2Bug #74514 5 session functions incorrectly warn when calling in read-only/getter mode.
3--EXTENSIONS--
4session
5--SKIPIF--
6<?php
7include('skipif.inc');
8?>
9--FILE--
10<?php
11/*
12CLI ignores HTTP headers at all, i.e. does not output any HTTP headers,
13but it still uses SG(headers_sent).
14
15CLI works as Web server, so SG(headers_sent) cannot be ignored nor changed.
16Therefore, once HTTP header is considered as sent, these functions emits
17'headers already sent' errors if they try to set new values.
18
19Older PHPs(<7.2) did not care about this misuse on Web SAPI.
20*/
21var_dump(session_name('foo'));
22var_dump(session_name());
23var_dump(session_module_name());
24var_dump(session_save_path());
25var_dump(session_cache_limiter());
26var_dump(session_cache_expire());
27?>
28--EXPECT--
29string(9) "PHPSESSID"
30string(3) "foo"
31string(5) "files"
32string(0) ""
33string(7) "nocache"
34int(180)
35