diff options
author | Felipe Pena <felipe@php.net> | 2011-05-19 23:20:47 +0000 |
---|---|---|
committer | Felipe Pena <felipe@php.net> | 2011-05-19 23:20:47 +0000 |
commit | 6f3c7a8b7016323dfe7f794e8dd29b49293b225d (patch) | |
tree | 08d217bf48849b6d591c41d24be9a621ece0ce22 | |
parent | 00842d6996227c0094cc17d5fb6161e59f3018a5 (diff) | |
download | php-git-6f3c7a8b7016323dfe7f794e8dd29b49293b225d.tar.gz |
- Fixed bug #54804 (__halt_compiler and imported namespaces) (Pierrick)
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | Zend/tests/bug54804.inc | 3 | ||||
-rw-r--r-- | Zend/tests/bug54804.phpt | 11 | ||||
-rw-r--r-- | Zend/zend_compile.c | 4 |
4 files changed, 20 insertions, 0 deletions
@@ -5,6 +5,8 @@ PHP NEWS - Upgraded bundled PCRE to version 8.12. (Scott) - Zend Engine: + . Fixed bug #54804 (__halt_compiler and imported namespaces). + (Pierrick, Felipe) . Fixed bug #54585 (track_errors causes segfault). (Dmitry) . Fixed bug #54423 (classes from dl()'ed extensions are not destroyed). (Tony, Dmitry) diff --git a/Zend/tests/bug54804.inc b/Zend/tests/bug54804.inc new file mode 100644 index 0000000000..74b7a1681d --- /dev/null +++ b/Zend/tests/bug54804.inc @@ -0,0 +1,3 @@ +<?php +namespace b\c {} +namespace b\d {} diff --git a/Zend/tests/bug54804.phpt b/Zend/tests/bug54804.phpt new file mode 100644 index 0000000000..c68e946982 --- /dev/null +++ b/Zend/tests/bug54804.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #54804 (__halt_compiler and imported namespaces) +--FILE-- +<?php +namespace a; +require __DIR__ . '/bug54804.inc'; +echo 'DONE'; +__halt_compiler(); +?> +--EXPECT-- +DONE diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 42a890ef85..d6ac7e3e4d 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3749,6 +3749,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); + } } /* }}} */ |