Skip to content

Commit b4ba66d

Browse files
committed
[BUGFIX] Address changed behavior in PHP's stream_wrapper_restore()
* since PHP 8.0-RC1 * since PHP 7.3.24 * since PHP 7.4.12 * see php/php-src@5ed0602 * see php/php-src#6183
1 parent d6bdc21 commit b4ba66d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/PharStreamWrapper.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -495,14 +495,15 @@ private function invokeInternalStreamWrapper(string $functionName, ...$arguments
495495

496496
private function restoreInternalSteamWrapper()
497497
{
498-
if (PHP_VERSION_ID < 80000) {
498+
if (PHP_VERSION_ID < 70324
499+
|| PHP_VERSION_ID >= 70400 && PHP_VERSION_ID < 70412) {
499500
stream_wrapper_restore('phar');
500501
} else {
501-
// PHP 8 has changed behaviour and this emits a notice when there is
502-
// nothing to restore.
502+
// with https://github.com/php/php-src/pull/6183 (PHP #76943) the
503+
// behavior of `stream_wrapper_restore()` did change for
504+
// PHP 8.0-RC1, 7.4.12 and 7.3.24
503505
@stream_wrapper_restore('phar');
504506
}
505-
506507
}
507508

508509
private function registerStreamWrapper()

0 commit comments

Comments
 (0)