summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-07-23 11:57:02 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-07-25 10:42:10 +0200
commit1cbcf0f4f1e9a14b3fc76f6d3e53b567a9464fd4 (patch)
treec90f41f18aa20ea31ad32d2260a49c2ad56f890c
parentdee243d475b088189862d30755aac7bb9cdd61b3 (diff)
downloadphp-git-1cbcf0f4f1e9a14b3fc76f6d3e53b567a9464fd4.tar.gz
Throw notice for plain wrapper fread/fwrite errors
Similar to what is done for socket read/write errors.
-rw-r--r--UPGRADING2
-rw-r--r--ext/fileinfo/tests/bug61964-mb.phpt5
-rw-r--r--ext/fileinfo/tests/bug61964.phpt5
-rw-r--r--ext/standard/tests/file/007_variation1.phpt2
-rw-r--r--ext/standard/tests/file/007_variation11-win32-mb.phpt2
-rw-r--r--ext/standard/tests/file/007_variation11-win32.phpt2
-rw-r--r--ext/standard/tests/file/007_variation11.phpt2
-rw-r--r--ext/standard/tests/file/007_variation13-win32.phpt2
-rw-r--r--ext/standard/tests/file/007_variation13.phpt2
-rw-r--r--ext/standard/tests/file/007_variation15.phpt2
-rw-r--r--ext/standard/tests/file/007_variation17.phpt2
-rw-r--r--ext/standard/tests/file/007_variation19.phpt2
-rw-r--r--ext/standard/tests/file/007_variation21.phpt2
-rw-r--r--ext/standard/tests/file/007_variation23.phpt2
-rw-r--r--ext/standard/tests/file/007_variation3.phpt2
-rw-r--r--ext/standard/tests/file/007_variation5.phpt2
-rw-r--r--ext/standard/tests/file/007_variation7.phpt2
-rw-r--r--ext/standard/tests/file/007_variation9.phpt2
-rw-r--r--ext/standard/tests/file/bug35781.phpt3
-rw-r--r--ext/standard/tests/file/fgetc_variation3.phpt20
-rw-r--r--ext/standard/tests/file/fgetcsv_variation26.phpt146
-rw-r--r--ext/standard/tests/file/fgets_variation1.phpt20
-rw-r--r--ext/standard/tests/file/fgetss_variation1-win32.phpt20
-rw-r--r--ext/standard/tests/file/fgetss_variation1.phpt20
-rw-r--r--ext/standard/tests/file/fputcsv_variation14.phpt54
-rw-r--r--ext/standard/tests/file/fread_variation2.phpt290
-rw-r--r--ext/standard/tests/file/fread_variation4-win32.phpt469
-rw-r--r--ext/standard/tests/file/fread_variation4.phpt232
-rw-r--r--ext/standard/tests/file/fscanf_variation51.phpt128
-rw-r--r--ext/standard/tests/file/fwrite.phpt2
-rw-r--r--ext/standard/tests/file/fwrite_variation1-win32-mb.phpt50
-rw-r--r--ext/standard/tests/file/fwrite_variation1.phpt50
-rw-r--r--ext/standard/tests/filters/bug35916.phpt4
-rw-r--r--ext/standard/tests/streams/bug54946.phpt7
-rw-r--r--main/streams/plain_wrapper.c21
-rw-r--r--main/streams/streams.c4
-rwxr-xr-xscripts/dev/bless_tests.php1
37 files changed, 954 insertions, 629 deletions
diff --git a/UPGRADING b/UPGRADING
index 5d38e596aa..3765c39639 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -142,6 +142,8 @@ PHP 7.4 UPGRADE NOTES
. 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
diff --git a/ext/fileinfo/tests/bug61964-mb.phpt b/ext/fileinfo/tests/bug61964-mb.phpt
index bee1c8f9ad..8432a8314e 100644
--- a/ext/fileinfo/tests/bug61964-mb.phpt
+++ b/ext/fileinfo/tests/bug61964-mb.phpt
@@ -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
diff --git a/ext/fileinfo/tests/bug61964.phpt b/ext/fileinfo/tests/bug61964.phpt
index 49829e98d8..b2eb6e2f16 100644
--- a/ext/fileinfo/tests/bug61964.phpt
+++ b/ext/fileinfo/tests/bug61964.phpt
@@ -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
diff --git a/ext/standard/tests/file/007_variation1.phpt b/ext/standard/tests/file/007_variation1.phpt
index c05ca6fdf0..f22fdc0dc9 100644
--- a/ext/standard/tests/file/007_variation1.phpt
+++ b/ext/standard/tests/file/007_variation1.phpt
@@ -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"
diff --git a/ext/standard/tests/file/007_variation11-win32-mb.phpt b/ext/standard/tests/file/007_variation11-win32-mb.phpt
index c2e42f68d2..fc24ba3853 100644
--- a/ext/standard/tests/file/007_variation11-win32-mb.phpt
+++ b/ext/standard/tests/file/007_variation11-win32-mb.phpt
@@ -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)
diff --git a/ext/standard/tests/file/007_variation11-win32.phpt b/ext/standard/tests/file/007_variation11-win32.phpt
index 7b6ae81465..f52e211ea5 100644
--- a/ext/standard/tests/file/007_variation11-win32.phpt
+++ b/ext/standard/tests/file/007_variation11-win32.phpt
@@ -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)
diff --git a/ext/standard/tests/file/007_variation11.phpt b/ext/standard/tests/file/007_variation11.phpt
index 3748f6f962..6bc9975104 100644
--- a/ext/standard/tests/file/007_variation11.phpt
+++ b/ext/standard/tests/file/007_variation11.phpt
@@ -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)
diff --git a/ext/standard/tests/file/007_variation13-win32.phpt b/ext/standard/tests/file/007_variation13-win32.phpt
index 72292d057f..d588cc4235 100644
--- a/ext/standard/tests/file/007_variation13-win32.phpt
+++ b/ext/standard/tests/file/007_variation13-win32.phpt
@@ -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)
diff --git a/ext/standard/tests/file/007_variation13.phpt b/ext/standard/tests/file/007_variation13.phpt
index a35b244c93..742d06a487 100644
--- a/ext/standard/tests/file/007_variation13.phpt
+++ b/ext/standard/tests/file/007_variation13.phpt
@@ -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)
diff --git a/ext/standard/tests/file/007_variation15.phpt b/ext/standard/tests/file/007_variation15.phpt
index 41fa58f02c..128ed2fc46 100644
--- a/ext/standard/tests/file/007_variation15.phpt
+++ b/ext/standard/tests/file/007_variation15.phpt
@@ -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)
diff --git a/ext/standard/tests/file/007_variation17.phpt b/ext/standard/tests/file/007_variation17.phpt
index 780ea96365..b817526365 100644
--- a/ext/standard/tests/file/007_variation17.phpt
+++ b/ext/standard/tests/file/007_variation17.phpt
@@ -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"
diff --git a/ext/standard/tests/file/007_variation19.phpt b/ext/standard/tests/file/007_variation19.phpt
index b10b4b5069..316616fa14 100644
--- a/ext/standard/tests/file/007_variation19.phpt
+++ b/ext/standard/tests/file/007_variation19.phpt
@@ -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)
diff --git a/ext/standard/tests/file/007_variation21.phpt b/ext/standard/tests/file/007_variation21.phpt
index fec0db24e4..37b1797491 100644
--- a/ext/standard/tests/file/007_variation21.phpt
+++ b/ext/standard/tests/file/007_variation21.phpt
@@ -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)
diff --git a/ext/standard/tests/file/007_variation23.phpt b/ext/standard/tests/file/007_variation23.phpt
index 81060fa1b1..eafa408eac 100644
--- a/ext/standard/tests/file/007_variation23.phpt
+++ b/ext/standard/tests/file/007_variation23.phpt
@@ -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)
diff --git a/ext/standard/tests/file/007_variation3.phpt b/ext/standard/tests/file/007_variation3.phpt
index 3572ca746f..59fb4587f9 100644
--- a/ext/standard/tests/file/007_variation3.phpt
+++ b/ext/standard/tests/file/007_variation3.phpt
@@ -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)
diff --git a/ext/standard/tests/file/007_variation5.phpt b/ext/standard/tests/file/007_variation5.phpt
index 40f0794c8b..5e4fc5c9db 100644
--- a/ext/standard/tests/file/007_variation5.phpt
+++ b/ext/standard/tests/file/007_variation5.phpt
@@ -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)
diff --git a/ext/standard/tests/file/007_variation7.phpt b/ext/standard/tests/file/007_variation7.phpt
index 322e1ee44c..40e22c4655 100644
--- a/ext/standard/tests/file/007_variation7.phpt
+++ b/ext/standard/tests/file/007_variation7.phpt
@@ -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)
diff --git a/ext/standard/tests/file/007_variation9.phpt b/ext/standard/tests/file/007_variation9.phpt
index a730240fa3..c20d3b4cf1 100644
--- a/ext/standard/tests/file/007_variation9.phpt
+++ b/ext/standard/tests/file/007_variation9.phpt
@@ -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"
diff --git a/ext/standard/tests/file/bug35781.phpt b/ext/standard/tests/file/bug35781.phpt
index b7ffa98760..30b49beb78 100644
--- a/ext/standard/tests/file/bug35781.phpt
+++ b/ext/standard/tests/file/bug35781.phpt
@@ -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
diff --git a/ext/standard/tests/file/fgetc_variation3.phpt b/ext/standard/tests/file/fgetc_variation3.phpt
index 8e052907e8..67f5c76ff4 100644
--- a/ext/standard/tests/file/fgetc_variation3.phpt
+++ b/ext/standard/tests/file/fgetc_variation3.phpt
@@ -49,12 +49,14 @@ 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)
@@ -62,6 +64,8 @@ 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)
@@ -69,6 +73,8 @@ 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)
@@ -76,6 +82,8 @@ 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)
@@ -83,6 +91,8 @@ 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)
@@ -90,6 +100,8 @@ 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)
@@ -97,6 +109,8 @@ 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)
@@ -104,6 +118,8 @@ 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)
@@ -111,6 +127,8 @@ 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)
diff --git a/ext/standard/tests/file/fgetcsv_variation26.phpt b/ext/standard/tests/file/fgetcsv_variation26.phpt
index 16f080aaf2..289972acb3 100644
--- a/ext/standard/tests/file/fgetcsv_variation26.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation26.phpt
@@ -76,365 +76,509 @@ foreach ($csv_lists as $csv_list) {
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)
diff --git a/ext/standard/tests/file/fgets_variation1.phpt b/ext/standard/tests/file/fgets_variation1.phpt
index b4f7ad5a0e..50856df2e0 100644
--- a/ext/standard/tests/file/fgets_variation1.phpt
+++ b/ext/standard/tests/file/fgets_variation1.phpt
@@ -48,12 +48,14 @@ foreach ($file_modes as $file_mode ) {
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)
@@ -61,6 +63,8 @@ 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)
@@ -68,6 +72,8 @@ 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)
@@ -75,6 +81,8 @@ 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)
@@ -82,6 +90,8 @@ 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)
@@ -89,6 +99,8 @@ 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)
@@ -96,6 +108,8 @@ 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)
@@ -103,6 +117,8 @@ 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)
@@ -110,6 +126,8 @@ 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)
diff --git a/ext/standard/tests/file/fgetss_variation1-win32.phpt b/ext/standard/tests/file/fgetss_variation1-win32.phpt
index 54c48e4280..72e19c293f 100644
--- a/ext/standard/tests/file/fgetss_variation1-win32.phpt
+++ b/ext/standard/tests/file/fgetss_variation1-win32.phpt
@@ -79,7 +79,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) {
echo "Done\n";
?>
---EXPECT--
+--EXPECTF--
*** Testing fgetss() : usage variations ***
-- Testing fgetss() with file opened using w mode --
@@ -88,6 +88,8 @@ bool(true)
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)
@@ -98,6 +100,8 @@ bool(true)
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)
@@ -108,6 +112,8 @@ bool(true)
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)
@@ -118,6 +124,8 @@ bool(true)
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)
@@ -128,6 +136,8 @@ bool(true)
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)
@@ -138,6 +148,8 @@ bool(true)
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)
@@ -148,6 +160,8 @@ bool(true)
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)
@@ -158,6 +172,8 @@ bool(true)
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)
@@ -168,6 +184,8 @@ bool(true)
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)
diff --git a/ext/standard/tests/file/fgetss_variation1.phpt b/ext/standard/tests/file/fgetss_variation1.phpt
index 391e0ec4af..e1a202388c 100644
--- a/ext/standard/tests/file/fgetss_variation1.phpt
+++ b/ext/standard/tests/file/fgetss_variation1.phpt
@@ -75,7 +75,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) {
echo "Done\n";
?>
---EXPECT--
+--EXPECTF--
*** Testing fgetss() : usage variations ***
-- Testing fgetss() with file opened using w mode --
@@ -84,6 +84,8 @@ bool(true)
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)
@@ -94,6 +96,8 @@ bool(true)
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)
@@ -104,6 +108,8 @@ bool(true)
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)
@@ -114,6 +120,8 @@ bool(true)
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)
@@ -124,6 +132,8 @@ bool(true)
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)
@@ -134,6 +144,8 @@ bool(true)
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)
@@ -144,6 +156,8 @@ bool(true)
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)
@@ -154,6 +168,8 @@ bool(true)
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)
@@ -164,6 +180,8 @@ bool(true)
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)
diff --git a/ext/standard/tests/file/fputcsv_variation14.phpt b/ext/standard/tests/file/fputcsv_variation14.phpt
index abc794de34..79576e4656 100644
--- a/ext/standard/tests/file/fputcsv_variation14.phpt
+++ b/ext/standard/tests/file/fputcsv_variation14.phpt
@@ -89,6 +89,8 @@ echo "Done\n";
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)
@@ -99,6 +101,8 @@ string(0) ""
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)
@@ -109,6 +113,8 @@ string(0) ""
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)
@@ -119,6 +125,8 @@ string(0) ""
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)
@@ -129,6 +137,8 @@ string(0) ""
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)
@@ -139,6 +149,8 @@ string(0) ""
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)
@@ -149,6 +161,8 @@ string(0) ""
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)
@@ -159,6 +173,8 @@ string(0) ""
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)
@@ -169,6 +185,8 @@ string(0) ""
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)
@@ -179,6 +197,8 @@ string(0) ""
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)
@@ -189,6 +209,8 @@ string(0) ""
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)
@@ -199,6 +221,8 @@ string(0) ""
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)
@@ -209,6 +233,8 @@ string(0) ""
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)
@@ -219,6 +245,8 @@ string(0) ""
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)
@@ -229,6 +257,8 @@ string(0) ""
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)
@@ -239,6 +269,8 @@ string(0) ""
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)
@@ -249,6 +281,8 @@ string(0) ""
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)
@@ -259,6 +293,8 @@ string(0) ""
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)
@@ -269,6 +305,8 @@ string(0) ""
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)
@@ -279,6 +317,8 @@ string(0) ""
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)
@@ -289,6 +329,8 @@ string(0) ""
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)
@@ -299,6 +341,8 @@ string(0) ""
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)
@@ -309,6 +353,8 @@ string(0) ""
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)
@@ -319,6 +365,8 @@ string(0) ""
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)
@@ -329,6 +377,8 @@ string(0) ""
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)
@@ -339,6 +389,8 @@ string(0) ""
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)
@@ -349,6 +401,8 @@ string(0) ""
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)
diff --git a/ext/standard/tests/file/fread_variation2.phpt b/ext/standard/tests/file/fread_variation2.phpt
index a3c8efb0b0..908ce90f2e 100644
--- a/ext/standard/tests/file/fread_variation2.phpt
+++ b/ext/standard/tests/file/fread_variation2.phpt
@@ -103,7 +103,7 @@ foreach($file_content_types as $file_content_type) {
echo "Done\n";
?>
---EXPECT--
+--EXPECTF--
*** Testing fread() : usage variations ***
-- Testing fread() with file having content of type numeric --
@@ -111,14 +111,18 @@ echo "Done\n";
-- 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)
@@ -126,14 +130,18 @@ 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)
@@ -141,14 +149,18 @@ 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)
@@ -156,14 +168,18 @@ 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)
@@ -171,14 +187,18 @@ 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)
@@ -186,14 +206,18 @@ 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)
@@ -201,14 +225,18 @@ 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)
@@ -216,14 +244,18 @@ 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)
@@ -231,14 +263,18 @@ 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)
@@ -248,14 +284,18 @@ 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)
@@ -263,14 +303,18 @@ 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)
@@ -278,14 +322,18 @@ 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)
@@ -293,14 +341,18 @@ 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)
@@ -308,14 +360,18 @@ 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)
@@ -323,14 +379,18 @@ 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)
@@ -338,14 +398,18 @@ 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)
@@ -353,14 +417,18 @@ 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)
@@ -368,14 +436,18 @@ 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)
@@ -385,14 +457,18 @@ 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)
@@ -400,14 +476,18 @@ 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)
@@ -415,14 +495,18 @@ 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)
@@ -430,14 +514,18 @@ 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)
@@ -445,14 +533,18 @@ 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)
@@ -460,14 +552,18 @@ 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)
@@ -475,14 +571,18 @@ 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)
@@ -490,14 +590,18 @@ 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)
@@ -505,14 +609,18 @@ 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)
@@ -522,14 +630,18 @@ 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)
@@ -537,14 +649,18 @@ 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)
@@ -552,14 +668,18 @@ 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)
@@ -567,14 +687,18 @@ 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)
@@ -582,14 +706,18 @@ 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)
@@ -597,14 +725,18 @@ 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)
@@ -612,14 +744,18 @@ 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)
@@ -627,14 +763,18 @@ 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)
@@ -642,14 +782,18 @@ 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)
diff --git a/ext/standard/tests/file/fread_variation4-win32.phpt b/ext/standard/tests/file/fread_variation4-win32.phpt
deleted file mode 100644
index 94328ac542..0000000000
--- a/ext/standard/tests/file/fread_variation4-win32.phpt
+++ /dev/null
@@ -1,469 +0,0 @@
---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
diff --git a/ext/standard/tests/file/fread_variation4.phpt b/ext/standard/tests/file/fread_variation4.phpt
index 538c441f1f..de2fceb034 100644
--- a/ext/standard/tests/file/fread_variation4.phpt
+++ b/ext/standard/tests/file/fread_variation4.phpt
@@ -1,11 +1,5 @@
--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
/*
@@ -107,7 +101,7 @@ foreach($file_content_types as $file_content_type) {
echo"Done\n";
?>
---EXPECT--
+--EXPECTF--
*** Testing fread() : usage variations ***
-- Testing fread() with file having content of type numeric --
@@ -115,117 +109,153 @@ echo"Done\n";
-- 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)
@@ -234,117 +264,153 @@ 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)
@@ -353,117 +419,153 @@ 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
diff --git a/ext/standard/tests/file/fscanf_variation51.phpt b/ext/standard/tests/file/fscanf_variation51.phpt
index d03ba68896..712e1e18c7 100644
--- a/ext/standard/tests/file/fscanf_variation51.phpt
+++ b/ext/standard/tests/file/fscanf_variation51.phpt
@@ -65,88 +65,214 @@ if(file_exists($filename)) {
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 ***
diff --git a/ext/standard/tests/file/fwrite.phpt b/ext/standard/tests/file/fwrite.phpt
index 3f8123a8f7..7cdb270ae3 100644
--- a/ext/standard/tests/file/fwrite.phpt
+++ b/ext/standard/tests/file/fwrite.phpt
@@ -35,6 +35,8 @@ bool(false)
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)
diff --git a/ext/standard/tests/file/fwrite_variation1-win32-mb.phpt b/ext/standard/tests/file/fwrite_variation1-win32-mb.phpt
index ec3cdd756a..706c765f8c 100644
--- a/ext/standard/tests/file/fwrite_variation1-win32-mb.phpt
+++ b/ext/standard/tests/file/fwrite_variation1-win32-mb.phpt
@@ -78,16 +78,20 @@ foreach($file_content_types as $file_content_type) {
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)
@@ -96,10 +100,14 @@ int(1024)
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)
@@ -108,10 +116,14 @@ int(1024)
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)
@@ -122,10 +134,14 @@ string(32) "950b7457d1deb6332f2fc5d42f3129d6"
-- 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)
@@ -134,10 +150,14 @@ int(1024)
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)
@@ -146,10 +166,14 @@ int(1024)
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)
@@ -160,10 +184,14 @@ string(32) "e486000c4c8452774f746a27658d87fa"
-- 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)
@@ -172,10 +200,14 @@ int(1024)
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)
@@ -184,10 +216,14 @@ int(1024)
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)
@@ -198,10 +234,14 @@ string(32) "b09c8026a64a88d36d4c2f17983964bb"
-- 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)
@@ -210,10 +250,14 @@ int(1024)
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)
@@ -222,10 +266,14 @@ int(1024)
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)
diff --git a/ext/standard/tests/file/fwrite_variation1.phpt b/ext/standard/tests/file/fwrite_variation1.phpt
index c141aa5880..20bde9b71a 100644
--- a/ext/standard/tests/file/fwrite_variation1.phpt
+++ b/ext/standard/tests/file/fwrite_variation1.phpt
@@ -70,16 +70,20 @@ foreach($file_content_types as $file_content_type) {
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)
@@ -88,10 +92,14 @@ int(1024)
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)
@@ -100,10 +108,14 @@ int(1024)
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)
@@ -114,10 +126,14 @@ string(32) "950b7457d1deb6332f2fc5d42f3129d6"
-- 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)
@@ -126,10 +142,14 @@ int(1024)
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)
@@ -138,10 +158,14 @@ int(1024)
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)
@@ -152,10 +176,14 @@ string(32) "e486000c4c8452774f746a27658d87fa"
-- 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)
@@ -164,10 +192,14 @@ int(1024)
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)
@@ -176,10 +208,14 @@ int(1024)
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)
@@ -190,10 +226,14 @@ string(32) "b09c8026a64a88d36d4c2f17983964bb"
-- 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)
@@ -202,10 +242,14 @@ int(1024)
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)
@@ -214,10 +258,14 @@ int(1024)
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)
diff --git a/ext/standard/tests/filters/bug35916.phpt b/ext/standard/tests/filters/bug35916.phpt
index 8c853023b1..578e462bd9 100644
--- a/ext/standard/tests/filters/bug35916.phpt
+++ b/ext/standard/tests/filters/bug35916.phpt
@@ -36,7 +36,9 @@ fclose($fp);
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
diff --git a/ext/standard/tests/streams/bug54946.phpt b/ext/standard/tests/streams/bug54946.phpt
index f220e9afba..0f58d19647 100644
--- a/ext/standard/tests/streams/bug54946.phpt
+++ b/ext/standard/tests/streams/bug54946.phpt
@@ -31,8 +31,13 @@ fclose($stream);
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===
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index 3c6a9afb28..bce58f7df2 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -351,6 +351,16 @@ static ssize_t php_stdiop_write(php_stream *stream, const char *buf, size_t coun
#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 {
@@ -415,11 +425,14 @@ static ssize_t php_stdiop_read(php_stream *stream, char *buf, size_t count)
/* 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;
diff --git a/main/streams/streams.c b/main/streams/streams.c
index 296bf9600e..45bdc828b9 100644
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -1240,7 +1240,9 @@ PHPAPI ssize_t _php_stream_write(php_stream *stream, const char *buf, size_t cou
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;
}
diff --git a/scripts/dev/bless_tests.php b/scripts/dev/bless_tests.php
index 190ebfb86a..25a4843c07 100755
--- a/scripts/dev/bless_tests.php
+++ b/scripts/dev/bless_tests.php
@@ -53,6 +53,7 @@ function normalizeOutput(string $out): string {
$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;
}