Bug #80439 [Fbk->NoF]: is_callable() does not call autoloader function

From: Date: Sun, 06 Dec 2020 04:22:08 +0000
Subject: Bug #80439 [Fbk->NoF]: is_callable() does not call autoloader function
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230882@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80439&edit=1

 ID:               80439
 Updated by:       php-bugs@lists.php.net
 Reported by:      jozyah-etienne at eerees dot com
 Summary:          is_callable() does not call autoloader function
-Status:           Feedback
+Status:           No Feedback
 Type:             Bug
 Package:          *General Issues
 Operating System: Linux
 PHP Version:      8.0.0
 Assigned To:      cmb
 Private report:   N

 New Comment:

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.


Previous Comments:
------------------------------------------------------------------------
[2020-11-29 00:03:42] cmb@php.net

This is_callable() checks for a *static* class method, but the
method appears to be non-static[1].  As of PHP 8.0.0, static calls
of non-static methods are no longer allowed[2].  Are you sure that
the class is not loaded?

[1] <https://3v4l.org/5p6c3>
[2] <https://www.php.net/manual/en/migration80.incompatible.php#migration80.incompatible.core.other>

------------------------------------------------------------------------
[2020-11-28 23:15:01] jozyah-etienne at eerees dot com

Description:
------------
It seems that is callable behavior is changed.
In PHP < 8, is_callable() includes needed class file through autoloader and returns .
In PHP 8 it returns false.


$callback = ['\Path\To\ClassName, 'methodName'];
is_callable($callback); // always returns false in PHP 8
$callback(); // but loads needed files through autoloader and executes the callback

Expected result:
----------------
It should loads needed files through autoloader and returns a valid value.

Actual result:
--------------
Always returns false, no matter if it is really callable or not.


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=80439&edit=1


Thread (3 messages)

« previous php.bugs (#230882) next »