#36322 [NEW]: bcompiler_write_file() includes all known function names
| From: | bugs_php_net_20060207 at mainskill dot com | Date: | Tue, 07 Feb 2006 16:32:20 +0000 |
| Subject: | #36322 [NEW]: bcompiler_write_file() includes all known function names | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-93021@lists.php.net to get a copy of this message | ||
From: bugs_php_net_20060207 at mainskill dot com
Operating system: debian sarge linux
PHP version: 4.4.2
PHP Bug Type: Program Execution
Bug description: bcompiler_write_file() includes all known function names
Description:
------------
Compiling using bcompiler will somehow include a list of all functions
that are defined at the time of calling bcompiler_write_file(). If X() is
defined in the compilation script itself, the resulting program has a
problem defining function X() or calling function_exists("X") as a zero
sized reply is returned.
Reproduce code:
---------------
compile script:
...
function file_put_contents($filename, $data, $flags = 0, $f = FALSE)
{...}
...
if (!bcompiler_write_header($fh)) echo "error writing header for:
".$filename."\n";
if (!bcompiler_write_file($fh, $tmpFilename)) echo "error compiling file
".$filename."\n";
if (!bcompiler_write_footer($fh)) echo "error writing footer for:
".$filename."\n";
...
resulting compiled file:
function file_put_contents($filename, $data, $flags = 0, $f = FALSE)
{...}
//THIS LEADS TO A ZERO SIZE REPLY
//Under some not known circumstances an error message is shown that
file_put_contents cannot be redeclared.
// PHP version used was <5.0.0 so this function was *not* defined by the
PHP environment itself
Expected result:
----------------
The compiled file should accept the new function and continue normally.
Actual result:
--------------
Fatal error: Cannot redeclare file_put_contents() (previously declared in
/tmp/myfile.php:48) in /tmp/myfile.php on line 48
It can easily be seen that this is the same file and the same line number.
If the function file_put_contents() had been renamed in the script we use
for compilation it works fine.
--
Edit bug report at http://bugs.php.net/?id=36322&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36322&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36322&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36322&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36322&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=36322&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36322&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36322&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36322&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36322&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36322&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=36322&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=36322&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36322&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36322&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36322&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36322&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36322&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36322&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36322&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36322&r=mysqlcfg