php-src/Zend/tests/arg_unpack/non_integer_keys.phpt
Dmitry Stogov 3a8f26060c Argument unpacking with Traversables and non-integer keys.
Changed error message, added UPGRADING note and test.
2018-07-04 22:34:36 +03:00

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