Bug #75186 [Com]: Inconsistent reflection of Closure:::__invoke()

From: Date: Wed, 28 Feb 2018 20:08:21 +0000
Subject: Bug #75186 [Com]: Inconsistent reflection of Closure:::__invoke()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214152@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75186&edit=1 ID: 75186 Comment by: carusogabriel34 at gmail dot com Reported by: kontakt at kukulich dot cz Summary: Inconsistent reflection of Closure:::__invoke() Status: Open Type: Bug Package: Reflection related PHP Version: Irrelevant Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2018-02-07 20:24:02] kontakt at kukulich dot cz See the test in the description. ------------------------------------------------------------------------ [2018-02-07 16:02:15] carusogabriel34 at gmail dot com Could not reproduced https://3v4l.org/mGJjd ------------------------------------------------------------------------ [2017-09-11 12:37:00] 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) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75186&edit=1

« previous php.bugs (#214152) next »