summaryrefslogtreecommitdiff
path: root/Zend/tests/generators/generator_with_type_check_2.phpt
blob: d8ea4fbf0d710365cf097054f7a89f2e6052c37e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--TEST--
Generator wit type check
--FILE--
<?php
function gen(array $a) { yield; }
try {
	gen(42);
} catch (TypeError $e) {
	echo $e->getMessage()."\n";
}

try {
	foreach (gen(42) as $val) {
		var_dump($val);
	}
} catch (TypeError $e) {
        echo $e->getMessage()."\n";
}
?>
--EXPECTF--
Argument 1 passed to gen() must be of the type array, integer given, called in %sgenerator_with_type_check_2.php on line 4
Argument 1 passed to gen() must be of the type array, integer given, called in %sgenerator_with_type_check_2.php on line 10