mirror of
https://github.com/php/php-src.git
synced 2024-12-13 11:54:45 +08:00
35 lines
568 B
PHP
35 lines
568 B
PHP
--TEST--
|
|
list() with non-integer-or-string keys
|
|
--FILE--
|
|
<?php
|
|
|
|
$results = [
|
|
0 => 0,
|
|
1 => 1,
|
|
"" => ""
|
|
];
|
|
|
|
list(NULL => $NULL, 1.5 => $float, FALSE => $FALSE, TRUE => $TRUE) = $results;
|
|
var_dump($NULL, $float, $FALSE, $TRUE);
|
|
|
|
echo PHP_EOL;
|
|
|
|
list("0" => $zeroString, "1" => $oneString) = $results;
|
|
var_dump($zeroString, $oneString);
|
|
|
|
list(STDIN => $resource) = [];
|
|
|
|
?>
|
|
--EXPECTF--
|
|
string(0) ""
|
|
int(1)
|
|
int(0)
|
|
int(1)
|
|
|
|
int(0)
|
|
int(1)
|
|
|
|
Notice: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
|
|
|
|
Notice: Undefined offset: 1 in %s on line %d
|