php.net |  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: -
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 1 (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
Description:
------------
https://3v4l.org/QBIvb

Test script:
---------------
<?php

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

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

var_dump(in_array('__invoke', $methodNames));
var_dump($rc->hasMethod('__invoke'));

Expected result:
----------------
bool(true)
bool(true)

Actual result:
--------------
bool(false)
bool(true)

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC