<?php
namespace Test;
class A
{
public function b(callable $b)
{
$b();
}
public function c()
{
echo 'c' . PHP_EOL;
}
}
$foo = new A();
echo '$f->c() is callable: ' . is_callable(array($foo, 'c')) . PHP_EOL;
$foo->b(array($foo, 'c'));
$f->c() is callable: 1
Catchable fatal error: Argument 1 passed to Test\A::b() must be an instance of Test\callable, array given, called in /in/2qWUC on line 20 and defined in /in/2qWUC on line 7
Process exited with code 255.