Skip to content

Commit 04c4854

Browse files
committed
Fixed bug #76754 (parent private constant in extends class memory leak)
1 parent 64c88c1 commit 04c4854

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ PHP NEWS
33
?? ??? ????, PHP 7.1.22
44

55
- Core:
6+
. Fixed bug #76754 (parent private constant in extends class memory leak).
7+
(Laruence)
68
. Fixed bug #72443 (Generate enabled extension). (petk)
79

810
- Bz2:

Zend/tests/bug76754.phpt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
Bug #76754 (parent private constant in extends class memory leak)
3+
--INI--
4+
opcache.enable=0
5+
opcache.enable_cli=0
6+
--FILE--
7+
<?php
8+
9+
class FOO
10+
{
11+
private const FOO = 'BAR';
12+
}
13+
14+
class BAR extends FOO { }
15+
?>
16+
okey
17+
--EXPECT--
18+
okey

Zend/zend_opcode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ ZEND_API void destroy_zend_class(zval *zv)
296296
}
297297
}
298298
} ZEND_HASH_FOREACH_END();
299-
zend_hash_destroy(&ce->constants_table);
300299
}
300+
zend_hash_destroy(&ce->constants_table);
301301
if (ce->num_interfaces > 0 && ce->interfaces) {
302302
efree(ce->interfaces);
303303
}

0 commit comments

Comments
 (0)