|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2013-11-11 03:23 UTC] kevin at herrera dot io
Description:
------------
If I require() a file within "namespace {}", I cannot call __HALT_COMPILER(); at the end of the script. Instead, I receive a fatal error.
Test script:
---------------
https://gist.github.com/kherge/7407259
Expected result:
----------------
Hello, world!
Actual result:
--------------
PHP Fatal error: No code may exist outside of namespace {} in /home/kherrera/Testing/b.php on line 3
PHP Stack trace:
PHP 1. {main}() /home/kherrera/Testing/a.php:0
Fatal error: No code may exist outside of namespace {} in /home/kherrera/Testing/b.php on line 3
Call Stack:
0.0001 235816 1. {main}() /home/kherrera/Testing/a.php:0
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 06 15:00:01 2026 UTC |
The behavior is not consistent, which is what confused me. I added "c.php", which shows "namespace {}" and "__halt_compiler" being used successfully together. https://gist.github.com/kherge/7407259#file-c-php