Bug #66077 [NEW]: Cannot use __HALT_COMPILER(); with require() in namespace.

From: Date: Mon, 11 Nov 2013 03:23:14 +0000
Subject: Bug #66077 [NEW]: Cannot use __HALT_COMPILER(); with require() in namespace.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-182695@lists.php.net to get a copy of this message
From: kevin at herrera dot io Operating system: Ubuntu 12.04 LTS PHP version: 5.5.5 Package: Scripting Engine problem Bug Type: Bug Bug description:Cannot use __HALT_COMPILER(); with require() in namespace. 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 -- Edit bug report at https://bugs.php.net/bug.php?id=66077&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66077&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66077&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66077&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=66077&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=66077&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=66077&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=66077&r=needscript Try newer version: https://bugs.php.net/fix.php?id=66077&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=66077&r=support Expected behavior: https://bugs.php.net/fix.php?id=66077&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=66077&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=66077&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=66077&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66077&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=66077&r=dst IIS Stability: https://bugs.php.net/fix.php?id=66077&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=66077&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=66077&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=66077&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=66077&r=mysqlcfg

« previous php.bugs (#182695) next »