#24967 [NEW]: fopen when placed within a function causes function to return

From: Date: Wed, 06 Aug 2003 21:13:54 +0000
Subject: #24967 [NEW]: fopen when placed within a function causes function to return
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-45477@lists.php.net to get a copy of this message
From: laurie at oneuponedown dot co dot uk Operating system: Linux PHP version: 4.3.2 PHP Bug Type: *Directory/Filesystem functions Bug description: fopen when placed within a function causes function to return Description: ------------ When using fopen inside a function to open a file for reading - irrerspective of weather fopen successfully opens the file, the use of fopen causes the function to return. Reproduce code: --------------- <html> <head> <title>TEST</title> </head> <body> <? function test () { // OPEN FILE FOR READING if ($ID = @fopen("/tmp/213.212.78.27.1060201522.txtfgbxdf","wb")) { // NOTHING FROM HERE DOWNWARDS IS EXCUTED // PRINT FIRST LINE OF FILE print(fgets($ID)); } else { // PRINT ERROR print("FOPEN FAILED"); } } ?> </body> </html> Expected result: ---------------- First line of file if success, "FOPEN FAILED" if fail. Actual result: -------------- Nothing -- Edit bug report at http://bugs.php.net/?id=24967&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=24967&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=24967&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=24967&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=24967&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=24967&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=24967&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=24967&r=support Expected behavior: http://bugs.php.net/fix.php?id=24967&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=24967&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=24967&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=24967&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24967&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=24967&r=dst IIS Stability: http://bugs.php.net/fix.php?id=24967&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=24967&r=gnused

« previous php.bugs (#45477) next »