Bug #76943 [NEW]: stream_wrapper_restore works differently before/after changes to the wrappers

From: Date: Thu, 27 Sep 2018 21:21:49 +0000
Subject: Bug #76943 [NEW]: stream_wrapper_restore works differently before/after changes to the wrappers
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217255@lists.php.net to get a copy of this message
From: martin at auswoeger dot com Operating system: PHP version: 7.2.10 Package: Streams related Bug Type: Bug Bug description:stream_wrapper_restore works differently before/after changes to the wrappers Description: ------------ The stream_wrapper_restore() function behaves very differently before and after one of the stream_wrapper_(un)register functions was called. It returns different values and triggers different notices. Test script: --------------- <?php echo "\nrestore foo: "; var_dump(stream_wrapper_restore('foo')); echo "\nrestore phar: "; var_dump(stream_wrapper_restore('phar')); stream_wrapper_register('bar', 'stdClass'); echo "\nrestore foo: "; var_dump(stream_wrapper_restore('foo')); echo "\nrestore phar: "; var_dump(stream_wrapper_restore('phar')); Expected result: ---------------- restore foo: Warning: stream_wrapper_restore(): foo:// never existed, nothing to restore in … on line 3 bool(false) restore phar: Notice: stream_wrapper_restore(): phar:// was never changed, nothing to restore in … on line 4 bool(true) restore foo: Warning: stream_wrapper_restore(): foo:// never existed, nothing to restore in … on line 8 bool(false) restore phar: Notice: stream_wrapper_restore(): phar:// was never changed, nothing to restore in … on line 9 bool(true) Actual result: -------------- restore foo: Notice: stream_wrapper_restore(): foo:// was never changed, nothing to restore in … on line 3 bool(true) restore phar: Notice: stream_wrapper_restore(): phar:// was never changed, nothing to restore in … on line 4 bool(true) restore foo: Warning: stream_wrapper_restore(): foo:// never existed, nothing to restore in … on line 8 bool(false) restore phar: bool(true) -- Edit bug report at https://bugs.php.net/bug.php?id=76943&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76943&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76943&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76943&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=76943&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=76943&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=76943&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=76943&r=needscript Try newer version: https://bugs.php.net/fix.php?id=76943&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=76943&r=support Expected behavior: https://bugs.php.net/fix.php?id=76943&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=76943&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=76943&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=76943&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76943&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=76943&r=dst IIS Stability: https://bugs.php.net/fix.php?id=76943&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=76943&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=76943&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=76943&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=76943&r=mysqlcfg

« previous php.bugs (#217255) next »