diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | Zend/tests/bug76754.phpt | 18 | ||||
-rw-r--r-- | Zend/zend_opcode.c | 2 |
3 files changed, 21 insertions, 1 deletions
@@ -3,6 +3,8 @@ PHP NEWS ?? ??? ????, PHP 7.1.22 - Core: + . Fixed bug #76754 (parent private constant in extends class memory leak). + (Laruence) . Fixed bug #72443 (Generate enabled extension). (petk) - Bz2: diff --git a/Zend/tests/bug76754.phpt b/Zend/tests/bug76754.phpt new file mode 100644 index 0000000000..424f1fbffc --- /dev/null +++ b/Zend/tests/bug76754.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #76754 (parent private constant in extends class memory leak) +--INI-- +opcache.enable=0 +opcache.enable_cli=0 +--FILE-- +<?php + +class FOO +{ + private const FOO = 'BAR'; +} + +class BAR extends FOO { } +?> +okey +--EXPECT-- +okey diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index fe1d95737a..8168f6a047 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -296,8 +296,8 @@ ZEND_API void destroy_zend_class(zval *zv) } } } ZEND_HASH_FOREACH_END(); - zend_hash_destroy(&ce->constants_table); } + zend_hash_destroy(&ce->constants_table); if (ce->num_interfaces > 0 && ce->interfaces) { efree(ce->interfaces); } |