From: csaba at alum dot mit dot edu Operating system: Win XP Pro PHP version: 5CVS-2005-09-04 (CVS) PHP Bug Type: CGI related Bug description: strange parsing of auto_prepend_file from CmdPrompt
Description: ------------ In a main script file, or included file, or auto_prepend_file it does not matter whether doSomething() is before or after function doSomething() {... does something...} However, this seems broken when the file is an auto_prepend_file and PHP is called from the command line in interactive mode. Specifically, two of the four scenarios below seem incorrect. Scenario 2 is the bug described here, whereas scenario 4 is a separate bug report (Bug 33430). Csaba Gabor from Vienna Reproduce code: --------------- Create a file pop.php (test will only work on a windows system because of the COM component): <?php popup ("inside pop.php"); function popup($text, $title="PHP popup") { $oWSH = new COM("WScript.Shell"); if (is_null($text)) $text = "NULL"; $oWSH->Popup($text, 4, $title, 131120); } ?> Now from the Cmd Prompt do the following 4 tests: 1. php.exe -d auto_prepend_file=pop.php 2. php.exe -d auto_prepend_file=pop.php -a 3. php.exe -d auto_prepend_file=pop.php pop.php 4. php.exe -d auto_prepend_file=pop.php -r print('Hi'); Expected result: ---------------- 1,2: I expect to get a single popup and then have PHP wait for input 3: I expect to get a single popup and then PHP should complain about popup being redifined 4: I should get a single popup and the output should show: Hi Actual result: -------------- 1, 3: As expected 2: The reason for this bug report: PHP dies and complains that it doesn't know what the definition of popup is. Note that if the invocation of popup is moved below the definition, the popup appears as expected. 4. The only thing that happens is that Hi is printed. The auto_prepend_file is not loaded so there is no popup. This is a separate bug report, Bug 33430, at http://bugs.php.net/33430 -- Edit bug report at http://bugs.php.net/?id=34367&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34367&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34367&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34367&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34367&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34367&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34367&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34367&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34367&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34367&r=support Expected behavior: http://bugs.php.net/fix.php?id=34367&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34367&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34367&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34367&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34367&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34367&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34367&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34367&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34367&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34367&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34367&r=mysqlcfg