php-src/Zend/tests/bug72943.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

21 lines
351 B
PHP

--TEST--
Bug #72943 (assign_dim on string doesn't reset hval)
--FILE--
<?php
$array = array("test" => 1);
$a = "lest";
var_dump($array[$a]);
$a[0] = "f";
var_dump($array[$a]);
$a[0] = "t";
var_dump($array[$a]);
?>
--EXPECTF--
Warning: Undefined array key "lest" in %s on line %d
NULL
Warning: Undefined array key "fest" in %s on line %d
NULL
int(1)