xref: /PHP-5.5/Zend/tests/closure_027.phpt (revision 850f9567)
1--TEST--
2Closure 027: Testing Closure type-hint
3--FILE--
4<?php
5
6function test(closure $a) {
7	var_dump($a());
8}
9
10
11test(function() { return new stdclass; });
12
13test(function() { });
14
15$a = function($x) use ($y) {};
16test($a);
17
18test(new stdclass);
19
20?>
21--EXPECTF--
22object(stdClass)#%d (0) {
23}
24NULL
25
26Notice: Undefined variable: y in %s on line %d
27
28Warning: Missing argument 1 for {closure}(), called in %s on line %d and defined in %s on line %d
29NULL
30
31Catchable fatal error: Argument 1 passed to test() must be an instance of Closure, instance of stdClass given, called in %s on line %d and defined in %s on line %d
32