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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kontakt at kukulich dot cz
New email:
PHP Version: OS:

 

 [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