#45032 [Fbk->Opn]: Argument passed as reference to fopen() freezes execution
ID: 45032 User updated by: partner55470745 at aravensoft dot com Reported By: partner55470745 at aravensoft dot com -Status: Feedback +Status: Open Bug Type: Unknown/Other Function Operating System: Debian Linux 4.0 PHP Version: 5.2.6 New Comment: Hello, I cannot use the latest snapshot because I only have a production server running the stable Debian. I have no test server, sorry. However, I didn't know that PHP did not accept a constant string as a parameter passed by reference. That is probably the cause. The only bug I see is any lack of warning/error during the execution. And I used error reporting level (E_ALL). Previous Comments: [2008-05-18 13:05:50] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows (zip): http://snaps.php.net/win32/php5.2-win32-latest.zip For Windows (installer): http://snaps.php.net/win32/php5.2-win32-installer-latest.msi This last script yields: "Fatal error: Only variables can be passed by reference" [2008-05-18 12:57:33] partner55470745 at aravensoft dot com Well the script itself is included in another script using require(). All files are pure .php scripts (no HTML) executed via browser (not CLI). MySQL is used in other parts of the scripts, but is not involved here. PHP Version 5.2.0-8+etch11 This is a shortened but functional version of my reproduce code: [2008-05-18 11:50:47] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with , is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. I can't reproduce. [2008-05-18 11:16:20] partner55470745 at aravensoft dot com Description: If an input function argument is passed as a reference (as opposed to as a value) and it is used as an argument to fopen(), parsing and/or execution of the script freezes without ANY warning or error whatsoever. Reproduce code: --- // This does NOT work (although it shoud) function log_an_event (&$logfile, &$event) { $f=fopen($logfile, 'a'); // ... } // This is a workaround for the above (first arg not passed as reference) function log_an_event ($logfile, &$event) { $f=fopen($logfile, 'a'); // ... } Expected result: Non-freezing execution. Actual result: -- Execution of the script freezes/exits without ANY warning or error whatsoever. -- Edit this bug report at http://bugs.php.net/?id=45032&edit=1
#45032 [Fbk->Opn]: Argument passed as reference to fopen() freezes execution
ID: 45032 User updated by: partner55470745 at aravensoft dot com Reported By: partner55470745 at aravensoft dot com -Status: Feedback +Status: Open Bug Type: Unknown/Other Function Operating System: Debian Linux 4.0 PHP Version: 5.2.6 New Comment: Well the script itself is included in another script using require(). All files are pure .php scripts (no HTML) executed via browser (not CLI). MySQL is used in other parts of the scripts, but is not involved here. PHP Version 5.2.0-8+etch11 This is a shortened but functional version of my reproduce code: Previous Comments: [2008-05-18 11:50:47] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with , is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. I can't reproduce. [2008-05-18 11:16:20] partner55470745 at aravensoft dot com Description: If an input function argument is passed as a reference (as opposed to as a value) and it is used as an argument to fopen(), parsing and/or execution of the script freezes without ANY warning or error whatsoever. Reproduce code: --- // This does NOT work (although it shoud) function log_an_event (&$logfile, &$event) { $f=fopen($logfile, 'a'); // ... } // This is a workaround for the above (first arg not passed as reference) function log_an_event ($logfile, &$event) { $f=fopen($logfile, 'a'); // ... } Expected result: Non-freezing execution. Actual result: -- Execution of the script freezes/exits without ANY warning or error whatsoever. -- Edit this bug report at http://bugs.php.net/?id=45032&edit=1
#45032 [NEW]: Argument passed as reference to fopen() freezes execution
From: partner55470745 at aravensoft dot com Operating system: Debian Linux 4.0 PHP version: 5.2.6 PHP Bug Type: Unknown/Other Function Bug description: Argument passed as reference to fopen() freezes execution Description: If an input function argument is passed as a reference (as opposed to as a value) and it is used as an argument to fopen(), parsing and/or execution of the script freezes without ANY warning or error whatsoever. Reproduce code: --- // This does NOT work (although it shoud) function log_an_event (&$logfile, &$event) { $f=fopen($logfile, 'a'); // ... } // This is a workaround for the above (first arg not passed as reference) function log_an_event ($logfile, &$event) { $f=fopen($logfile, 'a'); // ... } Expected result: Non-freezing execution. Actual result: -- Execution of the script freezes/exits without ANY warning or error whatsoever. -- Edit bug report at http://bugs.php.net/?id=45032&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45032&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45032&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45032&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=45032&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=45032&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=45032&r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=45032&r=needscript Try newer version:http://bugs.php.net/fix.php?id=45032&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=45032&r=support Expected behavior:http://bugs.php.net/fix.php?id=45032&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=45032&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=45032&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=45032&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45032&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=45032&r=dst IIS Stability:http://bugs.php.net/fix.php?id=45032&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=45032&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=45032&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=45032&r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=45032&r=mysqlcfg