php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36322 bcompiler_write_file() includes all known function names
Submitted: 2006-02-07 17:32 UTC Modified: 2006-02-07 18:10 UTC
From: bugs_php_net_20060207 at mainskill dot com Assigned:
Status: Not a bug Package: Program Execution
PHP Version: 4.4.2 OS: debian sarge linux
Private report: No CVE-ID: None
 [2006-02-07 17:32 UTC] bugs_php_net_20060207 at mainskill dot com
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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-07 18:10 UTC] tony2001@php.net
Please report all PECL related issues to PECL bug system:
http://pecl.php.net/bugs/
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 04:01:27 2024 UTC