Skip to content

Commit 18bde66

Browse files
committed
Merge branch 'PHP-5.6'
2 parents 52cdbc5 + 9d49492 commit 18bde66

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Zend/tests/bug67368.phpt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--TEST--
2+
Bug #67368 (Memory leak with immediately dereferenced array in class constant)
3+
--INI--
4+
report_memleaks=1
5+
--FILE--
6+
<?php
7+
class FooBar {
8+
const bar = ["bar" => 3]["bar"];
9+
}
10+
echo "okey";
11+
--EXPECTF--
12+
okey

Zend/zend_ast.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,7 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
328328
{
329329
zval *tmp;
330330
zend_fetch_dimension_by_zval(&tmp, &op1, &op2 TSRMLS_CC);
331-
*result = *tmp;
332-
efree(tmp);
331+
ZVAL_ZVAL(result, tmp, 1, 1);
333332
}
334333
zval_dtor(&op1);
335334
zval_dtor(&op2);

0 commit comments

Comments
 (0)