]> granicus.if.org Git - php/commitdiff
- Fixed bug #54804 (__halt_compiler and imported namespaces) (Pierrick)
authorFelipe Pena <felipe@php.net>
Thu, 19 May 2011 23:20:47 +0000 (23:20 +0000)
committerFelipe Pena <felipe@php.net>
Thu, 19 May 2011 23:20:47 +0000 (23:20 +0000)
Zend/tests/bug54804.inc [new file with mode: 0644]
Zend/tests/bug54804.phpt [new file with mode: 0644]
Zend/zend_compile.c

diff --git a/Zend/tests/bug54804.inc b/Zend/tests/bug54804.inc
new file mode 100644 (file)
index 0000000..74b7a16
--- /dev/null
@@ -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 (file)
index 0000000..c68e946
--- /dev/null
@@ -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
index 5c6778f6ca5cae92e6e7898aa3187e052acdcec8..a3f38d572c9c172cec98144cdb5bfcdfbf742289 100644 (file)
@@ -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);
+       }
 }
 /* }}} */