diff --git a/src/Framework/FileMutator.php b/src/Framework/FileMutator.php index 44e3e444..f2cb4270 100644 --- a/src/Framework/FileMutator.php +++ b/src/Framework/FileMutator.php @@ -135,7 +135,7 @@ public function stream_metadata(string $path, int $option, $value): bool public function stream_open(string $path, string $mode, int $options, ?string &$openedPath): bool { $usePath = (bool) ($options & STREAM_USE_PATH); - if (pathinfo($path, PATHINFO_EXTENSION) === 'php') { + if ($mode === 'rb' && pathinfo($path, PATHINFO_EXTENSION) === 'php') { $content = $this->native('file_get_contents', $path, $usePath, $this->context); if ($content === false) { return false;