mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
12
Zend/tests/closure_063.phpt
Normal file
12
Zend/tests/closure_063.phpt
Normal file
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Closure::bindTo leaks with "fake" closure
|
||||
--FILE--
|
||||
<?php
|
||||
function foo(){
|
||||
static $y;
|
||||
}
|
||||
Closure::fromCallable('foo')->bindTo(new stdClass);
|
||||
?>
|
||||
DONE
|
||||
--EXPECT--
|
||||
DONE
|
||||
@@ -770,7 +770,8 @@ static void zend_create_closure_ex(zval *res, zend_function *func, zend_class_en
|
||||
|
||||
ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr)
|
||||
{
|
||||
zend_create_closure_ex(res, func, scope, called_scope, this_ptr, /* is_fake */ false);
|
||||
zend_create_closure_ex(res, func, scope, called_scope, this_ptr,
|
||||
/* is_fake */ (func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE) != 0);
|
||||
}
|
||||
|
||||
ZEND_API void zend_create_fake_closure(zval *res, zend_function *func, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr) /* {{{ */
|
||||
|
||||
Reference in New Issue
Block a user