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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bugs_php_net_20060207 at mainskill dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 11:01:31 2025 UTC