1--TEST--
2Tests iterator_to_array() with non-scalar keys
3--FILE--
4<?php
5
6function gen() {
7    yield "foo" => 0;
8    yield 1     => 1;
9    yield 2.5   => 2;
10    yield null  => 3;
11    yield []    => 4;
12    yield new stdClass => 5;
13}
14
15try {
16    var_dump(iterator_to_array(gen()));
17} catch (Error $e) {
18    echo $e->getMessage(), "\n";
19}
20
21?>
22--EXPECT--
23Illegal offset type
24