2013-08-29 17:35:11 +08:00
|
|
|
--TEST--
|
|
|
|
Argument unpacking does not work with string keys (forward compatibility for named args)
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
|
|
|
|
set_error_handler(function($errno, $errstr) {
|
|
|
|
var_dump($errstr);
|
|
|
|
});
|
|
|
|
|
2015-03-09 20:57:15 +08:00
|
|
|
try {
|
|
|
|
var_dump(...[1, 2, "foo" => 3, 4]);
|
2015-05-17 05:49:14 +08:00
|
|
|
} catch (Error $ex) {
|
2015-03-09 20:57:15 +08:00
|
|
|
var_dump($ex->getMessage());
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
var_dump(...new ArrayIterator([1, 2, "foo" => 3, 4]));
|
2015-05-17 05:49:14 +08:00
|
|
|
} catch (Error $ex) {
|
2015-03-09 20:57:15 +08:00
|
|
|
var_dump($ex->getMessage());
|
|
|
|
}
|
2013-08-29 17:35:11 +08:00
|
|
|
|
|
|
|
?>
|
2018-02-19 16:59:41 +08:00
|
|
|
--EXPECT--
|
2013-08-29 17:35:11 +08:00
|
|
|
string(36) "Cannot unpack array with string keys"
|
|
|
|
string(42) "Cannot unpack Traversable with string keys"
|