#36322 [Opn->Bgs]: bcompiler_write_file() includes all known function names

From: Date: Tue, 07 Feb 2006 17:10:52 +0000
Subject: #36322 [Opn->Bgs]: bcompiler_write_file() includes all known function names
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-93022@lists.php.net to get a copy of this message
ID: 36322 Updated by: tony2001@php.net Reported By: bugs_php_net_20060207 at mainskill dot com -Status: Open +Status: Bogus Bug Type: Program Execution Operating System: debian sarge linux PHP Version: 4.4.2 New Comment: Please report all PECL related issues to PECL bug system: http://pecl.php.net/bugs/ Previous Comments: ------------------------------------------------------------------------ [2006-02-07 17:32:19] 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36322&edit=1

« previous php.bugs (#93022) next »