xref: /PHP-7.4/ext/session/tests/bug24592.phpt (revision 782352c5)
1--TEST--
2Bug #24592 (crash when multiple NULL values are being stored)
3--SKIPIF--
4<?php include('skipif.inc'); ?>
5--INI--
6html_errors=0
7session.save_handler=files
8--FILE--
9<?php
10@session_start();
11
12$foo = $_SESSION['foo'];
13$bar = $_SESSION['bar'];
14
15var_dump($foo, $bar, $_SESSION);
16
17$_SESSION['foo'] = $foo;
18$_SESSION['bar'] = $bar;
19
20var_dump($_SESSION);
21?>
22--EXPECTF--
23Notice: Undefined index: foo in %s on line %d
24
25Notice: Undefined index: bar in %s on line %d
26NULL
27NULL
28array(0) {
29}
30array(2) {
31  ["foo"]=>
32  NULL
33  ["bar"]=>
34  NULL
35}
36