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

22 lines
384 B
PHP

--TEST--
list() with undefined keys
--FILE--
<?php
$contrivedMixedKeyTypesExample = [
7 => "the best PHP version",
"elePHPant" => "the cutest mascot"
];
list(5 => $five, "duke" => $duke) = $contrivedMixedKeyTypesExample;
var_dump($five, $duke);
?>
--EXPECTF--
Warning: Undefined array key 5 in %s on line %d
Warning: Undefined array key "duke" in %s on line %d
NULL
NULL