Bug #77627 [Opn->Ver]: method_exists returns false for Closure::__invoke
Edit report at https://bugs.php.net/bug.php?id=77627&edit=1
ID: 77627
Updated by: cmb@php.net
Reported by: marcospassos dot com at gmail dot com
Summary: method_exists returns false for Closure::__invoke
-Status: Open
+Status: Verified
Type: Bug
Package: Reflection related
Operating System: Mac OS
PHP Version: 7.3.2
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2019-02-16 19:59:55] marcospassos dot com at gmail dot com
Description:
------------
The method_exists function returns false for Closure::__invoke.
According to the docs:
"Besides the methods listed here, this class also has an __invoke method. This is for
consistency with other classes that implement calling magic, as this method is not used for calling
the function."
Source: http://php.net/manual/en/class.closure.php
Test script:
---------------
https://3v4l.org/nIte4
Expected result:
----------------
true
Actual result:
--------------
false
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77627&edit=1
Thread (5 messages)