I don't know if it is a bug but when you test an array with a class and method, is_callable returns true for non static method.
Consider the following code:
<?php
class A
{
public static function test()
{
echo 'test', '<br>';
}
public function hello()
{
echo 'hello', '<br>';
}
}
echo "Static #1: call_user_func(array('A', 'test')) => ", call_user_func(array('A', 'test')), '<br>';
echo 'expect is_callable TRUE => ',
is_callable(array('A', 'test'))
? 'TRUE, A::test() is callable statically'
: 'FALSE, A::test() is not callable statically',
'<br><br>'
;
echo "Static #2: call_user_func(array('A', 'hello')) => ", call_user_func(array('A', 'hello')), '<br>';
echo 'expect is_callable FALSE => ',
is_callable(array('A', 'hello'))
? 'TRUE, A::hello() is callable statically'
: 'FALSE, A::hello() is not callable statically',
'<br><br>'
;
$a = new A();
echo "Instance #1: call_user_func(array(\$a, 'test')) => ", call_user_func(array($a, 'test')), '<br>';
echo 'expect is_callable TRUE => ',
is_callable(array($a, 'test'))
? 'TRUE, $a::test() is callable'
: 'FALSE, $a::test() is not callable',
'<br><br>'
;
echo "Instance #2: call_user_func(array(\$a, 'hello')) => ", call_user_func(array($a, 'hello')), '<br>';
echo 'expect is_callable FALSE => ',
is_callable(array($a, 'hello'))
? 'TRUE, $a::hello() is callable'
: 'FALSE, $a::hello() is not callable',
'<br><br>'
;
?>
Will output:
Static #1: call_user_func(array('A', 'test')) => test
expect is_callable TRUE => TRUE, A::test() is callable statically
Static #2: call_user_func(array('A', 'hello')) =>
Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method A::hello() should not be called statically in test.php on line 24
hello
expect is_callable FALSE => TRUE, A::hello() is callable statically
Instance #1: call_user_func(array($a, 'test')) => test
expect is_callable TRUE => TRUE, $a::test() is callable
Instance #2: call_user_func(array($a, 'hello')) => hello
expect is_callable TRUE => TRUE, $a::hello() is callable
------------------------------------------------------------
Also note that this works the same for inherited methods (I read other posts suggesting otherwise), and that private methods (static, inherited or both) always return false in any case as expected.
Tested with php 5.6.20.