Annotation of embedaddon/php/Zend/tests/callable_type_hint_001.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: callable type hint#001
3: --FILE--
4: <?php
5:
6: class bar {
7: function baz() {}
8: static function foo() {}
9: }
10: function foo(callable $bar) {
11: var_dump($bar);
12: }
13: $closure = function () {};
14:
15: foo("strpos");
16: foo("foo");
17: foo(array("bar", "baz"));
18: foo(array("bar", "foo"));
19: foo($closure);
20: --EXPECTF--
21: string(6) "strpos"
22: string(3) "foo"
23:
24: Strict Standards: Non-static method bar::baz() should not be called statically in %scallable_type_hint_001.php on line %d
25: array(2) {
26: [0]=>
27: string(3) "bar"
28: [1]=>
29: string(3) "baz"
30: }
31: array(2) {
32: [0]=>
33: string(3) "bar"
34: [1]=>
35: string(3) "foo"
36: }
37: object(Closure)#%d (0) {
38: }
39:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>