xref: /PHP-8.0/ext/session/tests/bug74514.phpt (revision a555cc0b)
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--EXPECT--
27string(9) "PHPSESSID"
28string(3) "foo"
29string(5) "files"
30string(0) ""
31string(7) "nocache"
32int(180)
33