xref: /PHP-7.4/ext/session/tests/009.phpt (revision 5a6d3cc4)
1--TEST--
2unset($_SESSION["name"]); should work with register_globals=off
3--SKIPIF--
4<?php include('skipif.inc'); ?>
5--INI--
6register_long_arrays=1
7session.use_cookies=0
8session.cache_limiter=
9register_globals=0
10session.bug_compat_42=1
11session.bug_compat_warn=0
12session.serialize_handler=php
13session.save_handler=files
14--FILE--
15<?php
16error_reporting(E_ALL);
17
18session_id("abtest");
19
20### Phase 1 cleanup
21session_start();
22session_destroy();
23
24### Phase 2 $HTTP_SESSION_VARS["c"] does not contain any value
25session_id("abtest");
26session_start();
27var_dump($HTTP_SESSION_VARS);
28$HTTP_SESSION_VARS["name"] = "foo";
29var_dump($HTTP_SESSION_VARS);
30session_write_close();
31
32### Phase 3 $HTTP_SESSION_VARS["c"] is set
33session_start();
34var_dump($HTTP_SESSION_VARS);
35unset($HTTP_SESSION_VARS["name"]);
36var_dump($HTTP_SESSION_VARS);
37session_write_close();
38
39### Phase 4 final
40
41session_start();
42var_dump($HTTP_SESSION_VARS);
43session_destroy();
44?>
45--EXPECT--
46array(0) {
47}
48array(1) {
49  ["name"]=>
50  string(3) "foo"
51}
52array(1) {
53  ["name"]=>
54  string(3) "foo"
55}
56array(0) {
57}
58array(0) {
59}
60PHP Warning:  Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater in Unknown on line 0
61