This commit is contained in:
Danack 2015-01-13 01:24:19 +00:00 committed by Stanislav Malyshev
parent af1f867308
commit dbc0a80b23
2 changed files with 19 additions and 0 deletions

View file

@ -449,6 +449,7 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent
closure->func = *func;
closure->func.common.prototype = NULL;
closure->func.common.fn_flags |= ZEND_ACC_CLOSURE;
if ((scope == NULL) && (this_ptr != NULL)) {
/* use dummy scope if we're binding an object without specifying a scope */

View file

@ -0,0 +1,18 @@
--TEST--
Bug #67068 (ReflectionFunction::getClosure returns something that doesn't report as a closure)
--FILE--
<?php
class MyClass {
public function method() {}
}
$object = new MyClass;
$reflector = new \ReflectionMethod($object, 'method');
$closure = $reflector->getClosure($object);
$closureReflector = new \ReflectionFunction($closure);
var_dump($closureReflector->isClosure());
?>
--EXPECT--
bool(true)