1
0
mirror of https://github.com/php/php-src.git synced 2026-04-14 11:32:11 +02:00
Files
archived-php-src/ext/spl/tests/iterator_to_array_nonscalar_keys.phpt
2019-09-27 13:00:07 +02:00

24 lines
368 B
PHP

--TEST--
Tests iterator_to_array() with non-scalar keys
--FILE--
<?php
function gen() {
yield "foo" => 0;
yield 1 => 1;
yield 2.5 => 2;
yield null => 3;
yield [] => 4;
yield new stdClass => 5;
}
try {
var_dump(iterator_to_array(gen()));
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Illegal offset type