Skip to content

Commit 0280d34

Browse files
committed
Skip closure caching in main
1 parent 9088615 commit 0280d34

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Zend/zend_compile.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8917,6 +8917,9 @@ static zend_op_array *zend_compile_func_decl_ex(
89178917

89188918
if ((op_array->fn_flags & ZEND_ACC_STATIC)
89198919
&& !op_array->static_variables
8920+
/* Don't cache closures in main, as those would leak without a proper
8921+
* cleanup mechanism. */
8922+
&& declaring_op_array->function_name
89208923
&& declaring_op_array->last) {
89218924
zend_op *declare_lambda_op = &declaring_op_array->opcodes[declaring_op_array->last - 1];
89228925
if (declare_lambda_op->opcode == ZEND_DECLARE_LAMBDA_FUNCTION) {

0 commit comments

Comments
 (0)