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--EXPECTF-- 23Deprecated: Implicit conversion from float 2.5 to int loses precision in %s on line %d 24Illegal offset type 25