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 [url]http://bugs.php.net/?id=24967&edit=1[/url]
--
Try a CVS snapshot (php4): [url]http://bugs.php.net/fix.php?id=24967&r=trysnapshot4[/url]
Try a CVS snapshot (php5): [url]http://bugs.php.net/fix.php?id=24967&r=trysnapshot5[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=24967&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=24967&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=24967&r=needtrace[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=24967&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=24967&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=24967&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=24967&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=24967&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=24967&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=24967&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=24967&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=24967&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=24967&r=gnused[/url]