xref: /php-src/ext/session/tests/bug74514.phpt (revision 092e090c)
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--EXPECTF--
29string(%d) "%S"
30string(%d) "%S"
31string(%d) "%S"
32string(%d) "%S"
33string(%d) "%S"
34int(%d)
35