1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-7.4'

* PHP-7.4:
  Fixed bug #79115
This commit is contained in:
Nikita Popov
2020-01-17 11:38:18 +01:00
2 changed files with 18 additions and 0 deletions

View File

@@ -4604,6 +4604,8 @@ ZEND_METHOD(reflection_class, isCloneable)
if (UNEXPECTED(object_init_ex(&obj, ce) != SUCCESS)) {
return;
}
/* We're not calling the constructor, so don't call the destructor either. */
zend_object_store_ctor_failed(Z_OBJ(obj));
RETVAL_BOOL(Z_OBJ_HANDLER(obj, clone_obj) != NULL);
zval_ptr_dtor(&obj);
}

View File

@@ -0,0 +1,16 @@
--TEST--
Bug #79115: ReflectionClass::isCloneable call reflected class __destruct
--FILE--
<?php
class A {
function __construct() { echo __FUNCTION__ . "\n"; }
function __destruct() { echo __FUNCTION__ . "\n"; }
}
$c = new ReflectionClass('A');
var_dump($c->isCloneable());
?>
--EXPECT--
bool(true)