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