Skip to content

Commit 1101293

Browse files
committed
- Fixed bug #54804 (__halt_compiler and imported namespaces) (Pierrick)
1 parent 4ad9f19 commit 1101293

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

Zend/tests/bug54804.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
namespace b\c {}
3+
namespace b\d {}

Zend/tests/bug54804.phpt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--TEST--
2+
Bug #54804 (__halt_compiler and imported namespaces)
3+
--FILE--
4+
<?php
5+
namespace a;
6+
require __DIR__ . '/bug54804.inc';
7+
echo 'DONE';
8+
__halt_compiler();
9+
?>
10+
--EXPECT--
11+
DONE

Zend/zend_compile.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5020,6 +5020,10 @@ void zend_do_halt_compiler_register(TSRMLS_D) /* {{{ */
50205020
zend_mangle_property_name(&name, &len, haltoff, sizeof(haltoff) - 1, cfilename, clen, 0);
50215021
zend_register_long_constant(name, len+1, zend_get_scanned_file_offset(TSRMLS_C), CONST_CS, 0 TSRMLS_CC);
50225022
pefree(name, 0);
5023+
5024+
if (CG(in_namespace)) {
5025+
zend_do_end_namespace(TSRMLS_C);
5026+
}
50235027
}
50245028
/* }}} */
50255029

0 commit comments

Comments
 (0)