mirror of
https://github.com/php/php-src.git
synced 2024-12-04 15:23:44 +08:00
3a8f26060c
Changed error message, added UPGRADING note and test.
22 lines
354 B
PHP
22 lines
354 B
PHP
--TEST--
|
|
Argument unpacking does not work with non-integer keys
|
|
--FILE--
|
|
<?php
|
|
function foo(...$args) {
|
|
var_dump($args);
|
|
}
|
|
function gen() {
|
|
yield 1.23 => 123;
|
|
yield "2.34" => 234;
|
|
}
|
|
|
|
try {
|
|
foo(...gen());
|
|
} catch (Error $ex) {
|
|
echo "Exception: " . $ex->getMessage() . "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
Exception: Cannot unpack Traversable with non-integer keys
|