php.net |  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
Description:
------------
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:
---------------
<?php
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
var_dump($closureReflector->isClosure());



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-02-01 07:20 UTC] stas@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: stas
 [2015-02-01 07:20 UTC] stas@php.net
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
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 02:01:28 2024 UTC