diff --git a/Zend/tests/bug54804.inc b/Zend/tests/bug54804.inc new file mode 100644 index 00000000000..74b7a1681d5 --- /dev/null +++ b/Zend/tests/bug54804.inc @@ -0,0 +1,3 @@ + +--EXPECT-- +DONE diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 5c6778f6ca5..a3f38d572c9 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -5020,6 +5020,10 @@ void zend_do_halt_compiler_register(TSRMLS_D) /* {{{ */ zend_mangle_property_name(&name, &len, haltoff, sizeof(haltoff) - 1, cfilename, clen, 0); zend_register_long_constant(name, len+1, zend_get_scanned_file_offset(TSRMLS_C), CONST_CS, 0 TSRMLS_CC); pefree(name, 0); + + if (CG(in_namespace)) { + zend_do_end_namespace(TSRMLS_C); + } } /* }}} */