|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2009-01-08 14:37 UTC] yarontal12 at gmail dot com
 Description:
------------
$fh = fopen("", "r");
that doesn't produce an error, but doesn't return a valid stream either.
Same problem with passing NULL or ''.
Reproduce code:
---------------
$fh = fopen("", "r");
Expected result:
----------------
Warning: fopen() [function.fopen]: failed to open stream: No such file or directory in test.php on line 2
Actual result:
--------------
nothing
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 04:00:01 2025 UTC | 
Yeah, I agree with you. Index: main/streams/streams.c =================================================================== RCS file: /repository/php-src/main/streams/streams.c,v retrieving revision 1.82.2.6.2.31 diff -u -p -r1.82.2.6.2.31 streams.c --- main/streams/streams.c 24 Nov 2008 15:37:33 -0000 1.82.2.6.2.31 +++ main/streams/streams.c 8 Jan 2009 15:47:34 -0000 @@ -1763,6 +1763,7 @@ PHPAPI php_stream *_php_stream_open_wrap } if (!path || !*path) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filename cannot be empty"); return NULL; }