summaryrefslogtreecommitdiff
path: root/Zend/tests/list_keyed_undefined.phpt
blob: fe1e86389a0cfd2a51429389d17b5e5c4862316a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--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--
Notice: Undefined array key 5 in %s on line %d

Notice: Undefined array key "duke" in %s on line %d
NULL
NULL