Bug #80323 [NEW]: is_callable() not same to type "callable"
| From: | antonfedonyuk at gmail dot com | Date: | Thu, 05 Nov 2020 17:59:11 +0000 |
| Subject: | Bug #80323 [NEW]: is_callable() not same to type "callable" | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-230146@lists.php.net to get a copy of this message | ||
From: antonfedonyuk at gmail dot com
Operating system: Any
PHP version: 7.2.34
Package: *General Issues
Bug Type: Bug
Bug description:is_callable() not same to type "callable"
Description:
------------
is_callable() return TRUE when we pass an array that represents a class
name and a non-static method. But if we pass that callback to function
with "callable" parameter it's generate error.
Test script:
---------------
class Test {
public function callback() {}
public function set(callable $callback) {}
}
$callback = ['Test', 'callback'];
Expected result:
----------------
is_callable($callback); // return FALSE
(new Test())->set($callback); // generate error
Actual result:
--------------
is_callable($callback); // return TRUE
(new Test())->set($callback); // generate error
--
Edit bug report at https://bugs.php.net/bug.php?id=80323&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80323&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80323&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80323&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80323&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80323&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80323&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80323&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80323&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80323&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80323&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80323&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80323&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80323&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80323&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80323&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80323&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80323&r=mysqlcfg