php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #54804
Patch bug_54804_with_test.diff revision 2011-05-19 11:04 UTC by pierrick@php.net
Patch bug_54804 revision 2011-05-19 10:46 UTC by pierrick@php.net

Patch bug_54804_with_test.diff for Scripting Engine problem Bug #54804

Patch version 2011-05-19 11:04 UTC

Return to Bug #54804 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: pierrick@php.net

Index: Zend/zend_compile.c
===================================================================
--- Zend/zend_compile.c	(revision 311143)
+++ Zend/zend_compile.c	(working copy)
@@ -3746,6 +3746,9 @@
 	int len, clen;
 	cfilename = zend_get_compiled_filename(TSRMLS_C);
 	clen = strlen(cfilename);
+	if (CG(in_namespace) && !CG(has_bracketed_namespaces)) {
+		zend_do_end_namespace(TSRMLS_C);
+	}
 	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);
Index: Zend/tests/bug54804.inc
===================================================================
--- Zend/tests/bug54804.inc	(revision 0)
+++ Zend/tests/bug54804.inc	(revision 0)
@@ -0,0 +1,3 @@
+<?php
+namespace b\c {}
+namespace b\d {}
Index: Zend/tests/bug54804.phpt
===================================================================
--- Zend/tests/bug54804.phpt	(revision 0)
+++ Zend/tests/bug54804.phpt	(revision 0)
@@ -0,0 +1,11 @@
+--TEST--
+Bug #54804 ()
+--FILE--
+<?php
+namespace a;
+require __DIR__ . '/bug54804.inc';
+echo 'DONE';
+__halt_compiler();
+?>
+--EXPECT--
+DONE
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 23 18:01:55 2014 UTC