Bug #80323 [Fbk]: is_callable() not same to type "callable"

From: Date: Thu, 05 Nov 2020 18:20:15 +0000
Subject: Bug #80323 [Fbk]: is_callable() not same to type "callable"
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230149@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80323&edit=1 ID: 80323 Updated by: levim@php.net Reported by: antonfedonyuk at gmail dot com Summary: is_callable() not same to type "callable" Status: Feedback Type: Bug Package: *General Issues Operating System: Any PHP Version: 7.2.34 Block user comment: N Private report: N New Comment: We had bugs in differences in is_callable and callable in the past, haven't we? Or maybe it was in is_callable/callable and actually calling it. I wonder if we could specifically fuzz this. Previous Comments: ------------------------------------------------------------------------ [2020-11-05 18:03:49] nikic@php.net I can't reproduce this: https://3v4l.org/Q10AR The call does not produce an error. ------------------------------------------------------------------------ [2020-11-05 17:59:11] antonfedonyuk at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=80323&edit=1

« previous php.bugs (#230149) next »