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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: knight at kopernet dot org
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Thu Nov 21 12:01:29 2024 UTC