xref: /PHP-8.0/ext/session/tests/bug70013.phpt (revision f34b858e)
1--TEST--
2Bug #70013 (Reference to $_SESSION is lost after a call to session_regenerate_id())
3--SKIPIF--
4<?php include('skipif.inc'); ?>
5--INI--
6session.save_handler=files
7--FILE--
8<?php
9ob_start();
10session_start();
11
12$session = &$_SESSION;
13
14$session['test'] = 1;
15session_regenerate_id(false);
16$session['test'] = 2;
17
18var_dump($session['test'] === $_SESSION['test']);
19
20$session['test'] = 3;
21session_regenerate_id(true);
22$session['test'] = 4;
23
24var_dump($session['test'] === $_SESSION['test']);
25?>
26--EXPECT--
27bool(true)
28bool(true)
29