|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67068 getClosure returns somethings that's not a closure
Submitted: 2014-04-13 22:23 UTC Modified: 2015-02-01 07:20 UTC
From: knight at kopernet dot org Assigned: stas (profile)
Status: Closed Package: Reflection related
PHP Version: 5.4.27 OS: Windows
Private report: No CVE-ID: None
 [2014-04-13 22:23 UTC] knight at kopernet dot org
When you try to reflect a closure that was created using ReflectionFunction/Method::getClosure() the reflection objects doesn't say it's a closure.

Test script:
class MyClass {
    public function method() {}

$object = new MyClass;
$reflector = new \ReflectionMethod($object, 'method');
$closure = $reflector->getClosure($object);

$closureReflector = new \ReflectionFunction($closure);

//expected bool(true) - got false


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-02-01 07:20 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: stas
 [2015-02-01 07:20 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 18 08:01:28 2024 UTC