string_keys.phpt 407 B

123456789101112131415161718
  1. --TEST--
  2. Argument unpacking does not work with string keys (forward compatibility for named args)
  3. --FILE--
  4. <?php
  5. set_error_handler(function($errno, $errstr) {
  6. var_dump($errstr);
  7. });
  8. try {
  9. var_dump(...new ArrayIterator([1, 2, "foo" => 3, 4]));
  10. } catch (Error $ex) {
  11. var_dump($ex->getMessage());
  12. }
  13. ?>
  14. --EXPECT--
  15. string(68) "Cannot use positional argument after named argument during unpacking"