summaryrefslogtreecommitdiff
path: root/ext/standard/tests/streams
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-09-22 16:11:56 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-09-22 16:12:37 +0200
commitff0f6c26c20b97e47f2bb70f631165e3a8801aac (patch)
tree952e64439718291568b79324740488e0a70ec97b /ext/standard/tests/streams
parentf445e9cb93eff1856748aaa6d020b74a653d2d76 (diff)
parent5ed0602ec622274bf5672304ae414e5ecb2e5167 (diff)
downloadphp-git-ff0f6c26c20b97e47f2bb70f631165e3a8801aac.tar.gz
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #76943: Inconsistent stream_wrapper_restore() errors
Diffstat (limited to 'ext/standard/tests/streams')
-rw-r--r--ext/standard/tests/streams/bug76943.phpt28
1 files changed, 28 insertions, 0 deletions
diff --git a/ext/standard/tests/streams/bug76943.phpt b/ext/standard/tests/streams/bug76943.phpt
new file mode 100644
index 0000000000..755c348f86
--- /dev/null
+++ b/ext/standard/tests/streams/bug76943.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Bug #76943 (Inconsistent stream_wrapper_restore() errors)
+--SKIPIF--
+<?php
+if (!in_array('phar', stream_get_wrappers())) die('skip phar wrapper not registered');
+?>
+--FILE--
+<?php
+var_dump(stream_wrapper_restore('foo'));
+var_dump(stream_wrapper_restore('phar'));
+
+stream_wrapper_register('bar', 'stdClass');
+
+var_dump(stream_wrapper_restore('foo'));
+var_dump(stream_wrapper_restore('phar'));
+?>
+--EXPECTF--
+Warning: stream_wrapper_restore(): foo:// never existed, nothing to restore in %s on line %d
+bool(false)
+
+Notice: stream_wrapper_restore(): phar:// was never changed, nothing to restore in %s on line %d
+bool(true)
+
+Warning: stream_wrapper_restore(): foo:// never existed, nothing to restore in %s on line %d
+bool(false)
+
+Notice: stream_wrapper_restore(): phar:// was never changed, nothing to restore in %s on line %d
+bool(true)