From: vovan-ve at yandex dot ru
Operating system:
PHP version: Irrelevant
Package: Class/Object related
Bug Type: Bug
Bug description:is_callable() lies for abstract static method
Description:
------------
The function is_callable() says, that abstract static method _IS_ callable.
But it is abstract, it has no body.
abstract class Foo {
abstract static function bar();
}
# PHP Strict Standards: Static function Foo::bar() should not be
abstract
# is Foo::bar() callable?
var_dump( is_callable(array("Foo", "bar")) );
# bool(true)
# O_o Ok, let's try...
Foo::bar();
# Fatal error: Cannot call abstract method Foo::bar()
Yes, I see a Strict. Anyway, is_callable() lies. I have checked this in
5.3.10, 5.3.6 and 5.2.17.
Test script:
---------------
abstract class Foo {
abstract static function bar();
}
var_dump( is_callable(array("Foo", "bar")) );
Foo::bar();
Expected result:
----------------
bool(false)
Fatal error
Actual result:
--------------
bool(true)
Fatal error
--
Edit bug report at https://bugs.php.net/bug.php?id=63111&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=63111&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=63111&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=63111&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=63111&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=63111&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=63111&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=63111&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=63111&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=63111&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=63111&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=63111&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=63111&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=63111&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=63111&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=63111&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=63111&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=63111&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=63111&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=63111&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=63111&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=63111&r=mysqlcfg