Skip to content

Throw notice for plain wrapper fread/fwrite errors #4462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ext/fileinfo/tests/bug61964-mb.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@ rmdir($dir);
?>
===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
Expand Down
5 changes: 2 additions & 3 deletions ext/fileinfo/tests/bug61964.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@ rmdir($dir);
?>
===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
Expand Down
2 changes: 2 additions & 0 deletions ext/standard/tests/file/007_variation1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ int(0)
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"
Expand Down
2 changes: 2 additions & 0 deletions ext/standard/tests/file/007_variation11-win32-mb.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ string(6) "stream"
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)
Expand Down
2 changes: 2 additions & 0 deletions ext/standard/tests/file/007_variation11-win32.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ string(6) "stream"
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)
Expand Down
2 changes: 2 additions & 0 deletions ext/standard/tests/file/007_variation11.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ string(6) "stream"
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)
Expand Down
2 changes: 2 additions & 0 deletions ext/standard/tests/file/007_variation13-win32.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ unlink(__DIR__."/007_variation13.tmp");
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)
Expand Down
2 changes: 2 additions & 0 deletions ext/standard/tests/file/007_variation13.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ unlink(__DIR__."/007_variation13.tmp");
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)
Expand Down
2 changes: 2 additions & 0 deletions ext/standard/tests/file/007_variation15.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ string(6) "stream"
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)
Expand Down
2 changes: 2 additions & 0 deletions ext/standard/tests/file/007_variation17.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ int(0)
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"
Expand Down
2 changes: 2 additions & 0 deletions ext/standard/tests/file/007_variation19.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ string(6) "stream"
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)
Expand Down
2 changes: 2 additions & 0 deletions ext/standard/tests/file/007_variation21.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ unlink(__DIR__."/007_variation21.tmp");
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)
Expand Down
2 changes: 2 additions & 0 deletions ext/standard/tests/file/007_variation23.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ string(6) "stream"
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)
Expand Down
2 changes: 2 additions & 0 deletions ext/standard/tests/file/007_variation3.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ string(6) "stream"
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)
Expand Down
2 changes: 2 additions & 0 deletions ext/standard/tests/file/007_variation5.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ unlink(__DIR__."/007_variation5.tmp");
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)
Expand Down
2 changes: 2 additions & 0 deletions ext/standard/tests/file/007_variation7.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ string(6) "stream"
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)
Expand Down
2 changes: 2 additions & 0 deletions ext/standard/tests/file/007_variation9.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ int(0)
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"
Expand Down
3 changes: 2 additions & 1 deletion ext/standard/tests/file/bug35781.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ var_dump(file_get_contents($filename));

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
20 changes: 19 additions & 1 deletion ext/standard/tests/file/fgetc_variation3.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -49,68 +49,86 @@ foreach ($file_modes as $file_mode ) {

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)
-- File opened in mode : wb --
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)
-- File opened in mode : wt --
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)
-- File opened in mode : a --
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)
-- File opened in mode : ab --
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)
-- File opened in mode : at --
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)
-- File opened in mode : x --
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)
-- File opened in mode : xb --
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)
-- File opened in mode : xt --
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)
Expand Down
Loading