summaryrefslogtreecommitdiff
path: root/Zend/tests/array_unpack/non_integer_keys.phpt
blob: 5c931029079596fcad12d5adfe38eb076562cafd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--TEST--
Array unpacking does not work with non-integer keys
--FILE--
<?php
function gen() {
	yield [] => 1;
	yield 1.23 => 123;
}

try {
	[...gen()];
} catch (Error $ex) {
	echo "Exception: " . $ex->getMessage() . "\n";
}

--EXPECT--
Exception: Cannot unpack Traversable with non-integer keys