mirror of
https://github.com/php/php-src.git
synced 2024-12-25 17:59:52 +08:00
ded3d984c6
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
25 lines
522 B
PHP
25 lines
522 B
PHP
--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);
|
|
});
|
|
|
|
try {
|
|
var_dump(...[1, 2, "foo" => 3, 4]);
|
|
} catch (Error $ex) {
|
|
var_dump($ex->getMessage());
|
|
}
|
|
try {
|
|
var_dump(...new ArrayIterator([1, 2, "foo" => 3, 4]));
|
|
} catch (Error $ex) {
|
|
var_dump($ex->getMessage());
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
string(36) "Cannot unpack array with string keys"
|
|
string(42) "Cannot unpack Traversable with string keys"
|