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