Despite the fact that constructors are the methods that are called when
an object is created, they are not static methods and
is_callable() will return false
for them. It's not
possible to use is_callable() to check if a class can
be instantiated from the current scope.
<?php
class Foo
{
public function __construct() {}
public function foo() {}
}
var_dump(
is_callable(['Foo', '__construct']),
is_callable(['Foo', 'foo'])
);
$foo = new Foo();
var_dump(is_callable([$foo, '__construct']));
?>
The above example will output:
bool(false)
bool(false)
bool(true)