|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75186 Inconsistent reflection of Closure:::__invoke()
Submitted: 2017-09-11 12:37 UTC Modified: -
Avg. Score:2.0 ± 1.0
Reproduced:0 of 2 (0.0%)
From: kontakt at kukulich dot cz Assigned:
Status: Open Package: Reflection related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-09-11 12:37 UTC] kontakt at kukulich dot cz

Test script:

$rc = new ReflectionClass(Closure::class);

$methodNames = array_map(function ($m) {
   return $m->getName();
}, $rc->getMethods());

var_dump(in_array('__invoke', $methodNames));

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-02-07 16:02 UTC] carusogabriel34 at gmail dot com
Could not reproduced
 [2018-02-07 20:24 UTC] kontakt at kukulich dot cz
See the test in the description.
 [2018-02-28 20:08 UTC] carusogabriel34 at gmail dot com
From the documentation:
> 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.

So I believe is the expected behavior.
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Thu Jun 21 11:01:49 2018 UTC