1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 01:02:25 +01:00
Files
archived-php-src/ext/session/tests/bug24592.phpt
Nikita Popov c48b745f00 Promote "undefined array key" notice to warning
This implements the last remaining part of the
https://wiki.php.net/rfc/engine_warnings RFC.

Closes GH-5927.
2020-08-03 14:40:50 +02:00

36 lines
548 B
PHP

--TEST--
Bug #24592 (crash when multiple NULL values are being stored)
--SKIPIF--
<?php include('skipif.inc'); ?>
--INI--
html_errors=0
session.save_handler=files
--FILE--
<?php
@session_start();
$foo = $_SESSION['foo'];
$bar = $_SESSION['bar'];
var_dump($foo, $bar, $_SESSION);
$_SESSION['foo'] = $foo;
$_SESSION['bar'] = $bar;
var_dump($_SESSION);
?>
--EXPECTF--
Warning: Undefined array key "foo" in %s on line %d
Warning: Undefined array key "bar" in %s on line %d
NULL
NULL
array(0) {
}
array(2) {
["foo"]=>
NULL
["bar"]=>
NULL
}