Skip to content

Commit

Permalink
[BUGFIX] Address changed behavior in PHP's stream_wrapper_restore()
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
andreaskienast authored and ohader committed Nov 11, 2020
1 parent 5e6269b commit 2e519bb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/PharStreamWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,15 @@ private function invokeInternalStreamWrapper($functionName)

private function restoreInternalSteamWrapper()
{
stream_wrapper_restore('phar');
if (PHP_VERSION_ID < 70324
|| PHP_VERSION_ID >= 70400 && PHP_VERSION_ID < 70412) {
stream_wrapper_restore('phar');
} else {
// with https://github.com/php/php-src/pull/6183 (PHP #76943) the
// behavior of `stream_wrapper_restore()` did change for
// PHP 8.0-RC1, 7.4.12 and 7.3.24
@stream_wrapper_restore('phar');
}
}

private function registerStreamWrapper()
Expand Down

0 comments on commit 2e519bb

Please sign in to comment.