php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54804 __halt_compiler and imported namespaces
Submitted: 2011-05-18 09:58 UTC Modified: 2011-05-20 01:21 UTC
From: vrai at moechofe dot com Assigned: pierrick (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3.6 OS: Ubuntu 11.01 2.6.38-8-generic
Private report: No CVE-ID: None
 [2011-05-18 09:58 UTC] vrai at moechofe dot com
Description:
------------
When importing namespace in a script using the __halt_compiler() function, the imported script must use the same type of declaration (bracketed namespace or unbracketed namespace).


Test script:
---------------
a.php
----
<?php
namespace a;
require_once 'b.php';
echo 'ok',PHP_EOL;
__halt_compiler(); // Remove this line and the script will works.

b.php
----
<?php
namespace b\c {}
namespace b\d {}


Expected result:
----------------
ok

Actual result:
--------------
Fatal error: Cannot mix bracketed namespace declarations with unbracketed namespace declarations in b.php on line 2

Patches

bug_54804_with_test.diff (last revision 2011-05-19 11:04 UTC by pierrick@php.net)
bug_54804 (last revision 2011-05-19 10:46 UTC by pierrick@php.net)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-19 12:46 UTC] pierrick@php.net
The following patch has been added/updated:

Patch Name: bug_54804
Revision:   1305801994
URL:        http://bugs.php.net/patch-display.php?bug=54804&patch=bug_54804&revision=1305801994
 [2011-05-19 12:52 UTC] pierrick@php.net
-Assigned To: +Assigned To: pierrick
 [2011-05-19 12:57 UTC] pajoye@php.net
Can you add a test case please?
 [2011-05-19 13:04 UTC] pierrick@php.net
The following patch has been added/updated:

Patch Name: bug_54804_with_test.diff
Revision:   1305803069
URL:        http://bugs.php.net/patch-display.php?bug=54804&patch=bug_54804_with_test.diff&revision=1305803069
 [2011-05-20 01:20 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=311276
Log: - Fixed bug #54804 (__halt_compiler and imported namespaces) (Pierrick)
 [2011-05-20 01:21 UTC] felipe@php.net
-Status: Assigned +Status: Closed
 [2011-05-20 01:21 UTC] felipe@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2011-05-20 01:21 UTC] felipe@php.net
-Package: Compile Failure +Package: Scripting Engine problem
 [2012-04-18 09:50 UTC] laruence@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=180146d49b2030551e98749678747ec8388e1fab
Log: - Fixed bug #54804 (__halt_compiler and imported namespaces) (Pierrick)
 [2012-07-24 23:41 UTC] rasmus@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=180146d49b2030551e98749678747ec8388e1fab
Log: - Fixed bug #54804 (__halt_compiler and imported namespaces) (Pierrick)
 [2013-11-17 09:38 UTC] laruence@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=180146d49b2030551e98749678747ec8388e1fab
Log: - Fixed bug #54804 (__halt_compiler and imported namespaces) (Pierrick)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 07 03:01:28 2024 UTC