|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-06-11 23:15 UTC] brandon at brandonsavage dot net
[2010-06-12 00:56 UTC] felipe@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: felipe
[2010-06-12 01:37 UTC] felipe@php.net
-Status: Assigned
+Status: Closed
[2010-06-12 01:37 UTC] felipe@php.net
[2010-06-12 01:37 UTC] felipe@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 12:00:01 2025 UTC |
Description: ------------ According to the documentation, the Closure class implements __construct() and __invoke(). However, when ReflectionClass::hasMethod() and ReflectionClass::getMethods() are run against a closure, they do not report the existence of the __invoke() method. On user-defined classes, the existence of __invoke() is reported if __invoke() is defined. Test script: --------------- $closure = function($a) { echo $a; }; $reflection = new ReflectionClass($closure); var_dump($reflection->hasMethod('__invoke()'); Expected result: ---------------- boolean true Actual result: -------------- boolean false