We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9088615 commit 0280d34Copy full SHA for 0280d34
1 file changed
Zend/zend_compile.c
@@ -8917,6 +8917,9 @@ static zend_op_array *zend_compile_func_decl_ex(
8917
8918
if ((op_array->fn_flags & ZEND_ACC_STATIC)
8919
&& !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
8923
&& declaring_op_array->last) {
8924
zend_op *declare_lambda_op = &declaring_op_array->opcodes[declaring_op_array->last - 1];
8925
if (declare_lambda_op->opcode == ZEND_DECLARE_LAMBDA_FUNCTION) {
0 commit comments