<?php
class Foo
{
public function bar()
{
}
}
function gimme_a_callable(callable $callable)
{
}
error_reporting(-1);
var_dump(is_callable([Foo::class, 'bar']));
gimme_a_callable([Foo::class, 'bar']);
bool(false)
Fatal error: Uncaught TypeError: gimme_a_callable(): Argument #1 ($callable) must be of type callable, array given, called in /in/akn6u on line 21 and defined in /in/akn6u:13
Stack trace:
#0 /in/akn6u(21): gimme_a_callable(Array)
#1 {main}
thrown in /in/akn6u on line 13
Process exited with code 255.