mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
commit
384dfe331b
4
NEWS
4
NEWS
@ -13,6 +13,10 @@ PHP NEWS
|
||||
. Fixed bug #79084 (mysqlnd may fetch wrong column indexes with MYSQLI_BOTH).
|
||||
(cmb)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #79115 (ReflectionClass::isCloneable call reflected class
|
||||
__destruct). (Nikita)
|
||||
|
||||
23 Jan 2020, PHP 7.4.2
|
||||
|
||||
- Core:
|
||||
|
@ -4528,6 +4528,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);
|
||||
}
|
||||
|
16
ext/reflection/tests/bug79115.phpt
Normal file
16
ext/reflection/tests/bug79115.phpt
Normal 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)
|
Loading…
Reference in New Issue
Block a user