#39903 [NEW]: Notice message when executing __halt_compiler() more than once
From: francois at tekwire dot net
Operating system: All
PHP version: 5.2.0
PHP Bug Type: Scripting Engine problem
Bug description: Notice message when executing __halt_compiler() more than once
Description:
------------
When __halt_compiler() is seen for the second time, PHP displays a message
saying:
Notice: Constant __COMPILER_HALT_OFFSET__ already defined in ...
Although it cannot happen in a single file, it can happen when including
two files containing an __halt_compiler() directive.
The constant should be undefined before calling
REGISTER_MAIN_LONG_CONSTANT("__C
OMPILER_HALT_OFFSET__", zend_get_scanned_file_offset(TSRMLS_C), CONST_CS)
in zend_language_parser.y but I haven't found any function to undefine a
constant...
Reproduce code:
---------------
* File a.php contains :
<?php
include 'b.php';
include 'c.php';
* File b.php and c.php both contain :
<?php
echo __FILE__."\n";
__halt_compiler();
data
* Run a.php
Expected result:
----------------
/depot/divers/flp/tmp/b.php
/depot/divers/flp/tmp/c.php
Actual result:
--------------
/depot/divers/flp/tmp/b.php
Notice: Constant __COMPILER_HALT_OFFSET__ already defined in
/depot/divers/flp/tmp/c.php on line 3
/depot/divers/flp/tmp/c.php
--
Edit bug report at http://bugs.php.net/?id=39903&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39903&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39903&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39903&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=39903&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=39903&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=39903&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=39903&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=39903&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=39903&r=support
Expected behavior: http://bugs.php.net/fix.php?id=39903&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=39903&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=39903&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=39903&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39903&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=39903&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=39903&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=39903&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=39903&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=39903&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=39903&r=mysqlcfg
Thread (4 messages)
- francois at tekwire dot net