summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 39ee2a1063..93766b98b5 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -5895,6 +5895,10 @@ void zend_compile_func_decl(znode *result, zend_ast *ast, zend_bool toplevel) /*
CG(active_op_array) = op_array;
+ if (toplevel) {
+ op_array->fn_flags |= ZEND_ACC_TOP_LEVEL;
+ }
+
zend_oparray_context_begin(&orig_oparray_context);
if (CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO) {