summaryrefslogtreecommitdiff
path: root/ext/standard/tests/file
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-09-22 18:57:21 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-09-23 10:54:06 +0200
commit2576c57a5133df757c51f341e794bf53add7663f (patch)
tree1c66ac4d095e5f7e147eec55131d6608a8be2b7e /ext/standard/tests/file
parent9439d65f0d74d391f9620491896a1a04bc033648 (diff)
downloadphp-git-2576c57a5133df757c51f341e794bf53add7663f.tar.gz
Fix #76735: Incorrect message in fopen on invalid mode
We have to log errors in `stream_opener` callbacks to the wrapper's error log, because otherwise we may pick up an unrelated `errno` or a most generic message. Closes GH-6187.
Diffstat (limited to 'ext/standard/tests/file')
-rw-r--r--ext/standard/tests/file/bug76735.phpt8
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/standard/tests/file/bug76735.phpt b/ext/standard/tests/file/bug76735.phpt
new file mode 100644
index 0000000000..451988cc65
--- /dev/null
+++ b/ext/standard/tests/file/bug76735.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Bug #76735 (Incorrect message in fopen on invalid mode)
+--FILE--
+<?php
+fopen(__FILE__, 'Q');
+?>
+--EXPECTF--
+Warning: fopen(%s): failed to open stream: `Q' is not a valid mode for fopen in %s on line %d