diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 59f4749..64a6b5f 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: true matrix: - php: [8.1, 8.2, 8.3] # + php: [8.1, 8.2, 8.3, 8.4] # os: [ubuntu-latest, macOS-latest] # windows-latest, # include: # - os: 'ubuntu-latest' diff --git a/src/File.php b/src/File.php index 9332a7c..1b1e600 100644 --- a/src/File.php +++ b/src/File.php @@ -191,7 +191,7 @@ public static function getContents( bool $useIncludePath = false, $context = null, int $offset = 0, - int $maxlen = null + ?int $maxlen = null ): string { if (!is_file($filename)) { throw new InvalidArgumentException("No such file: $filename"); diff --git a/src/Traits/FileSystemFuncTrait.php b/src/Traits/FileSystemFuncTrait.php index c4c18ef..c712c46 100644 --- a/src/Traits/FileSystemFuncTrait.php +++ b/src/Traits/FileSystemFuncTrait.php @@ -268,6 +268,10 @@ public static function realpath(string $path): string } $absolutes = []; + if ($path[0] === '/') { + $absolutes[] = '/'; + } + foreach ($parts as $part) { if ('.' === $part) { continue;