Similar to what is done for socket read/write errors.
. fread() and fwrite() will now return false if the operation failed.
Previously an empty string or 0 was returned. EAGAIN/EWOULDBLOCK are not
considered failures.
+ . fread() and fwrite() on plain files will now throw a notice on failure,
+ such as when trying to write to a read-only file resource.
- Tokenizer:
. token_get_all() will now emit a T_BAD_CHARACTER token for unexpected
?>
===DONE===
--EXPECTF--
-bool(false)
+bool(false)%A
resource(%d) of type (file_info)
resource(%d) of type (file_info)
-bool(false)
-
+bool(false)%A
Notice: finfo_open(): Warning: offset `string' invalid in %sbug61964-mb.php on line %d
Notice: finfo_open(): Warning: offset ` Core' invalid in %sbug61964-mb.php on line %d
?>
===DONE===
--EXPECTF--
-bool(false)
+bool(false)%A
resource(%d) of type (file_info)
resource(%d) of type (file_info)
-bool(false)
-
+bool(false)%A
Notice: finfo_open(): Warning: offset `string' invalid in %sbug61964.php on line %d
Notice: finfo_open(): Warning: offset ` Core' invalid in %sbug61964.php on line %d
string(20) "line
line of text
li"
+
+Notice: fwrite(): write of 37 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
bool(true)
string(7) "Unknown"
int(0)
int(37)
int(37)
+
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(true)
int(0)
int(37)
int(37)
+
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(true)
int(0)
int(37)
int(37)
+
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(true)
resource(%d) of type (stream)
string(6) "stream"
int(37)
+
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(true)
resource(%d) of type (stream)
string(6) "stream"
int(37)
+
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(true)
int(0)
int(37)
int(37)
+
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(true)
string(20) "line
line of text
li"
+
+Notice: fwrite(): write of 37 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
bool(true)
string(7) "Unknown"
int(0)
int(37)
int(37)
+
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(true)
resource(%d) of type (stream)
string(6) "stream"
int(37)
+
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(true)
int(0)
int(37)
int(37)
+
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(true)
int(0)
int(37)
int(37)
+
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(true)
resource(%d) of type (stream)
string(6) "stream"
int(37)
+
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(true)
int(0)
int(37)
int(37)
+
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(true)
string(20) "line
line of text
li"
+
+Notice: fwrite(): write of 37 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
bool(true)
string(7) "Unknown"
echo "Done\n";
?>
---EXPECT--
+--EXPECTF--
+Notice: fpassthru(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
string(15) "Guvf vf n grfg
"
Done
echo "Done\n";
?>
---EXPECT--
+--EXPECTF--
*** Testing fgetc() with file opened in write only mode ***
-- File opened in mode : w --
bool(true)
int(0)
bool(false)
+
+Notice: fgetc(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
bool(true)
int(0)
bool(false)
+
+Notice: fgetc(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
bool(true)
int(0)
bool(false)
+
+Notice: fgetc(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
bool(true)
int(0)
bool(false)
+
+Notice: fgetc(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
bool(true)
int(0)
bool(false)
+
+Notice: fgetc(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
bool(true)
int(0)
bool(false)
+
+Notice: fgetc(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
bool(true)
int(0)
bool(false)
+
+Notice: fgetc(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
bool(true)
int(0)
bool(false)
+
+Notice: fgetc(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
bool(true)
int(0)
bool(false)
+
+Notice: fgetc(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
echo "Done\n";
?>
---EXPECT--
+--EXPECTF--
*** Testing fgetcsv() : reading the files opened in write only mode ***
-- Testing fgetcsv() with file opened using w mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using wb mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using wt mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using a mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using ab mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using at mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using x mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using xb mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using xt mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using w mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using wb mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using wt mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using a mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using ab mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using at mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using x mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using xb mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using xt mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using w mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using wb mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using wt mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using a mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using ab mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using at mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using x mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using xb mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using xt mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using w mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using wb mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using wt mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using a mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using ab mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using at mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using x mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using xb mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using xt mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using w mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using wb mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using wt mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using a mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using ab mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using at mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using x mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using xb mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using xt mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using w mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using wb mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using wt mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using a mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using ab mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using at mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using x mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using xb mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using xt mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using w mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using wb mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using wt mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using a mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using ab mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using at mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using x mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using xb mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using xt mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using w mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using wb mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using wt mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using a mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using ab mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using at mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using x mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using xb mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
-- Testing fgetcsv() with file opened using xt mode --
+
+Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
echo "Done\n";
?>
---EXPECT--
+--EXPECTF--
*** Testing fgets() with file opened in write only mode ***
-- File opened in mode : w --
bool(true)
int(0)
bool(false)
+
+Notice: fgets(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
bool(true)
int(0)
bool(false)
+
+Notice: fgets(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
bool(true)
int(0)
bool(false)
+
+Notice: fgets(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
bool(true)
int(0)
bool(false)
+
+Notice: fgets(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
bool(true)
int(0)
bool(false)
+
+Notice: fgets(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
bool(true)
int(0)
bool(false)
+
+Notice: fgets(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
bool(true)
int(0)
bool(false)
+
+Notice: fgets(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
bool(true)
int(0)
bool(false)
+
+Notice: fgets(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
bool(true)
int(0)
bool(false)
+
+Notice: fgets(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
echo "Done\n";
?>
---EXPECT--
+--EXPECTF--
*** Testing fgetss() : usage variations ***
-- Testing fgetss() with file opened using w mode --
int(0)
bool(false)
-- fgetss() with default length, file pointer at 0 , expected : no character should be read --
+
+Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(0)
bool(false)
-- fgetss() with default length, file pointer at 0 , expected : no character should be read --
+
+Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(0)
bool(false)
-- fgetss() with default length, file pointer at 0 , expected : no character should be read --
+
+Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(0)
bool(false)
-- fgetss() with default length, file pointer at 0 , expected : no character should be read --
+
+Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(0)
bool(false)
-- fgetss() with default length, file pointer at 0 , expected : no character should be read --
+
+Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(0)
bool(false)
-- fgetss() with default length, file pointer at 0 , expected : no character should be read --
+
+Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(0)
bool(false)
-- fgetss() with default length, file pointer at 0 , expected : no character should be read --
+
+Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(0)
bool(false)
-- fgetss() with default length, file pointer at 0 , expected : no character should be read --
+
+Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(0)
bool(false)
-- fgetss() with default length, file pointer at 0 , expected : no character should be read --
+
+Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
echo "Done\n";
?>
---EXPECT--
+--EXPECTF--
*** Testing fgetss() : usage variations ***
-- Testing fgetss() with file opened using w mode --
int(0)
bool(false)
-- fgetss() with default length, file pointer at 0 , expected : no character should be read --
+
+Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(0)
bool(false)
-- fgetss() with default length, file pointer at 0 , expected : no character should be read --
+
+Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(0)
bool(false)
-- fgetss() with default length, file pointer at 0 , expected : no character should be read --
+
+Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(0)
bool(false)
-- fgetss() with default length, file pointer at 0 , expected : no character should be read --
+
+Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(0)
bool(false)
-- fgetss() with default length, file pointer at 0 , expected : no character should be read --
+
+Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(0)
bool(false)
-- fgetss() with default length, file pointer at 0 , expected : no character should be read --
+
+Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(0)
bool(false)
-- fgetss() with default length, file pointer at 0 , expected : no character should be read --
+
+Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(0)
bool(false)
-- fgetss() with default length, file pointer at 0 , expected : no character should be read --
+
+Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(0)
bool(false)
-- fgetss() with default length, file pointer at 0 , expected : no character should be read --
+
+Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 12 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 12 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 12 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 15 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 15 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 15 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 22 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 22 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 22 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 24 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 24 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
Notice: fputcsv(): delimiter must be a single character in %s on line %d
Notice: fputcsv(): enclosure must be a single character in %s on line %d
+
+Notice: fputcsv(): write of 24 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
echo "Done\n";
?>
---EXPECT--
+--EXPECTF--
*** Testing fread() : usage variations ***
-- Testing fread() with file having content of type numeric --
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading entire file content, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1024 bytes from file, expecting 0 bytes ... OK
+Reading 1024 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading file content less than max. file size, expeceted : 0 bytes --
int(0)
bool(false)
-Reading 1000 bytes from file, expecting 0 bytes ... OK
+Reading 1000 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
+++ /dev/null
---TEST--
-Test fread() function : usage variations - read beyond file size, write only mode
---SKIPIF--
-<?php
-if (substr(PHP_OS, 0, 3) != 'WIN') {
- die('skip...only valid for Windows');
-}
-?>
---FILE--
-<?php
-/*
- Prototype: string fread ( resource $handle [, int $length] );
- Description: reads up to length bytes from the file pointer referenced by handle.
- Reading stops when up to length bytes have been read, EOF (end of file) is
- reached, (for network streams) when a packet becomes available, or (after
- opening userspace stream) when 8192 bytes have been read whichever comes first.
-*/
-
-// include the file.inc for common functions for test
-include ("file.inc");
-
-/* Function : function check_read(resource $file_handle, int $read_size, int $expect_size)
- Description : Read data from file of size $read_size and verifies that $expected_size no. of
- bytes are read.
- $file_handle : File Handle
- $read_size : No. of bytes to be read.
- $expect_size : Expected data length
- Returns: returns the data read
-*/
-function check_read($file_handle, $read_size, $expect_size) {
- // print file pointer position before read
- var_dump( ftell($file_handle) );
- var_dump( feof($file_handle) );
-
- // read the data of size $read_size
- echo "Reading $read_size bytes from file, expecting $expect_size bytes ... ";
- $data_from_file = fread($file_handle, $read_size);
-
- // check if data read is of expected size
- if ( strlen($data_from_file) == $expect_size)
- echo "OK\n";
- else
- echo "Error reading file, total number of bytes read = ".strlen($data_from_file)."\n";
-
- // file pointer position after read
- var_dump( ftell($file_handle) );
- // check if file pointer at eof()
- var_dump( feof($file_handle) );
-
- return $data_from_file;
-}
-
-echo "*** Testing fread() : usage variations ***\n";
-
-$file_modes = array("a","ab","at",
- "w","wb","wt",
- "x","xb","xt" );
-
-$file_content_types = array("numeric","text","text_with_new_line");
-
-foreach($file_content_types as $file_content_type) {
- echo "\n-- Testing fread() with file having content of type ". $file_content_type ." --\n";
-
- /* open the file using $files_modes and perform fread() on it */
- foreach($file_modes as $file_mode) {
- if(!strstr($file_mode,"x")){
- /* create files with $file_content_type */
- create_files ( __DIR__, 1, $file_content_type, 0755, 1, "w", "fread_variation", 4);
- }
-
- $filename = __DIR__."/fread_variation4.tmp"; // this is name of the file created by create_files()
- echo "-- File opened in mode ".$file_mode." --\n";
- $file_handle = fopen($filename, $file_mode);
- if (!$file_handle) {
- echo "Error: failed to fopen() file: $filename!";
- exit();
- }
-
- if(strstr($file_mode,"w") || strstr($file_mode,"x") ) {
- fill_file($file_handle, $file_content_type, 1024);
- }
-
- rewind($file_handle);
- echo "-- Reading beyond filesize, expeceted : 1024 bytes --\n";
- // read file by giving size more than its size
- rewind($file_handle);
- $data_from_file = check_read($file_handle, 1030, ( strstr($file_mode, "+") ? 1024 : 0) );
- if ( $data_from_file != false)
- var_dump( md5($data_from_file) );
-
- echo "-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --\n";
- rewind($file_handle);
- // try fread when file pointer at end
- fseek($file_handle, 0, SEEK_END);
- //reading file when file pointer at end
- $data_from_file = check_read($file_handle, 10, 0);
- if ( $data_from_file != false)
- var_dump( md5($data_from_file) );
-
- // now close the file
- fclose($file_handle);
-
- // delete the file created
- delete_file($filename); // delete file
- } // end of inner foreach loop
-}// end of outer foreach loop
-
-echo"Done\n";
-?>
---EXPECT--
-*** Testing fread() : usage variations ***
-
--- Testing fread() with file having content of type numeric --
--- File opened in mode a --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode ab --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode at --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode w --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode wb --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode wt --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode x --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode xb --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode xt --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
-
--- Testing fread() with file having content of type text --
--- File opened in mode a --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode ab --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode at --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode w --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode wb --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode wt --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode x --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode xb --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode xt --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
-
--- Testing fread() with file having content of type text_with_new_line --
--- File opened in mode a --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode ab --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode at --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode w --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode wb --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode wt --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1137)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1137)
-bool(false)
--- File opened in mode x --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode xb --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
-bool(false)
--- File opened in mode xt --
--- Reading beyond filesize, expeceted : 1024 bytes --
-int(0)
-bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
-int(0)
-bool(false)
--- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1137)
-bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1137)
-bool(false)
-Done
--TEST--
Test fread() function : usage variations - read beyond file size, write only mode
---SKIPIF--
-<?php
-if (substr(PHP_OS, 0, 3) == 'WIN') {
- die('skip.. Not valid for Windows');
-}
-?>
--FILE--
<?php
/*
echo"Done\n";
?>
---EXPECT--
+--EXPECTF--
*** Testing fread() : usage variations ***
-- Testing fread() with file having content of type numeric --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode ab --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode at --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode w --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode wb --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode wt --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode x --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode xb --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode xt --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode ab --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode at --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode w --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode wb --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode wt --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode x --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode xb --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode xt --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode ab --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode at --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode w --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode wb --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode wt --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
+int(%r1024|1137%r)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
+int(%r1024|1137%r)
bool(false)
-- File opened in mode x --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode xb --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
int(1024)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(1024)
bool(false)
-- File opened in mode xt --
-- Reading beyond filesize, expeceted : 1024 bytes --
int(0)
bool(false)
-Reading 1030 bytes from file, expecting 0 bytes ... OK
+Reading 1030 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
int(0)
bool(false)
-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --
-int(1024)
+int(%r1024|1137%r)
bool(false)
-Reading 10 bytes from file, expecting 0 bytes ... OK
-int(1024)
+Reading 10 bytes from file, expecting 0 bytes ...
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
+OK
+int(%r1024|1137%r)
bool(false)
Done
unlink($filename);
}
?>
---EXPECT--
+--EXPECTF--
*** Test fscanf(): to read from a file opened in write only mode ***
-- iteration 1 --
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
-- iteration 2 --
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
-- iteration 3 --
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
-- iteration 4 --
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
-- iteration 5 --
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
-- iteration 6 --
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
-- iteration 7 --
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
-- iteration 8 --
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
-- iteration 9 --
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
+
+Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
*** Done ***
Warning: fwrite() expects parameter 2 to be string, array given in %s on line %d
bool(false)
+
+Notice: fwrite(): write of 4 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
int(4)
echo "Done\n";
?>
---EXPECT--
+--EXPECTF--
*** Testing fwrite() various operations ***
-- Testing fwrite() with file having content of type numeric --
-- Opening file in r --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
string(32) "950b7457d1deb6332f2fc5d42f3129d6"
-- Opening file in rb --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
string(32) "950b7457d1deb6332f2fc5d42f3129d6"
-- Opening file in rt --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
-- Testing fwrite() with file having content of type text --
-- Opening file in r --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
string(32) "e486000c4c8452774f746a27658d87fa"
-- Opening file in rb --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
string(32) "e486000c4c8452774f746a27658d87fa"
-- Opening file in rt --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
-- Testing fwrite() with file having content of type text_with_new_line --
-- Opening file in r --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
string(32) "b09c8026a64a88d36d4c2f17983964bb"
-- Opening file in rb --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
string(32) "b09c8026a64a88d36d4c2f17983964bb"
-- Opening file in rt --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
-- Testing fwrite() with file having content of type alphanumeric --
-- Opening file in r --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
-- Opening file in rb --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
-- Opening file in rt --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
echo "Done\n";
?>
---EXPECT--
+--EXPECTF--
*** Testing fwrite() various operations ***
-- Testing fwrite() with file having content of type numeric --
-- Opening file in r --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
string(32) "950b7457d1deb6332f2fc5d42f3129d6"
-- Opening file in rb --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
string(32) "950b7457d1deb6332f2fc5d42f3129d6"
-- Opening file in rt --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
-- Testing fwrite() with file having content of type text --
-- Opening file in r --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
string(32) "e486000c4c8452774f746a27658d87fa"
-- Opening file in rb --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
string(32) "e486000c4c8452774f746a27658d87fa"
-- Opening file in rt --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
-- Testing fwrite() with file having content of type text_with_new_line --
-- Opening file in r --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
string(32) "b09c8026a64a88d36d4c2f17983964bb"
-- Opening file in rb --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
string(32) "b09c8026a64a88d36d4c2f17983964bb"
-- Opening file in rt --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
-- Testing fwrite() with file having content of type alphanumeric --
-- Opening file in r --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
-- Opening file in rb --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
-- Opening file in rt --
int(0)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(0)
bool(false)
int(2)
+
+Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d
bool(false)
int(2)
bool(false)
readfile($file);
unlink($file);
?>
---EXPECT--
+--EXPECTF--
fffffffffff
+
+Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
hello
THANK YOU
unlink($filename);
?>
===DONE===
---EXPECT--
+--EXPECTF--
+Notice: stream_get_contents(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
string(0) ""
+
+Notice: stream_get_contents(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
string(0) ""
+
+Notice: stream_get_contents(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
string(0) ""
===DONE===
#else
ssize_t bytes_written = write(data->fd, buf, count);
#endif
+ if (bytes_written < 0) {
+ if (errno == EWOULDBLOCK || errno == EAGAIN) {
+ return 0;
+ }
+ if (errno == EINTR) {
+ /* TODO: Should this be treated as a proper error or not? */
+ return bytes_written;
+ }
+ php_error_docref(NULL, E_NOTICE, "write of %zu bytes failed with errno=%d %s", count, errno, strerror(errno));
+ }
return bytes_written;
} else {
/* Not an error. */
ret = 0;
} else if (errno == EINTR) {
- /* An error, but not EOF */
- } else if (errno == EBADF) {
- /* TODO: Remove this special-case? */
+ /* TODO: Should this be treated as a proper error or not? */
} else {
- stream->eof = 1;
+ php_error_docref(NULL, E_NOTICE, "read of %zu bytes failed with errno=%d %s", count, errno, strerror(errno));
+
+ /* TODO: Remove this special-case? */
+ if (errno != EBADF) {
+ stream->eof = 1;
+ }
}
} else if (ret == 0) {
stream->eof = 1;
return 0;
}
- if (buf == NULL || stream->ops->write == NULL) {
+ ZEND_ASSERT(buf != NULL);
+ if (stream->ops->write == NULL) {
+ php_error_docref(NULL, E_NOTICE, "Stream is not writable");
return (ssize_t) -1;
}
$out = preg_replace('/in \/.+:\d+$/m', 'in %s:%d', $out);
$out = preg_replace('/^#(\d+) \/.+\(\d+\):/m', '#$1 %s(%d):', $out);
$out = preg_replace('/Resource id #\d+/', 'Resource id #%d', $out);
+ $out = preg_replace('/resource\(\d+\) of type/', 'resource(%d) of type', $out);
$out = preg_replace('/string\(\d+\) "([^"]*%d)/', 'string(%d) "$1', $out);
return $out;
}