1--TEST-- 2callable type#001 3--FILE-- 4<?php 5 6class bar { 7 function baz() {} 8 static function foo() {} 9} 10function foo(callable $bar) { 11 var_dump($bar); 12} 13$closure = function () {}; 14 15foo("strpos"); 16foo("foo"); 17foo($closure); 18foo(array("bar", "foo")); 19foo(array("bar", "baz")); 20?> 21--EXPECTF-- 22string(6) "strpos" 23string(3) "foo" 24object(Closure)#1 (0) { 25} 26array(2) { 27 [0]=> 28 string(3) "bar" 29 [1]=> 30 string(3) "foo" 31} 32 33Fatal error: Uncaught TypeError: foo(): Argument #1 ($bar) must be of type callable, array given, called in %s:%d 34Stack trace: 35#0 %s(%d): foo(Array) 36#1 {main} 37 thrown in %s on line %d 38