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