[php-src] Issue #7976: is_readable() not working on files inside phar
| From: | petitj | Date: | Thu, 20 Jan 2022 13:37:38 +0000 |
| Subject: | [php-src] Issue #7976: is_readable() not working on files inside phar | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-239144@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/7976
Author: petitj
### Description
Using the following code to create a basic phar file:
```php
$stub = <<<STUB
<?php
Phar::interceptFileFuncs();
set_include_path("phar://archive.phar" . PATH_SEPARATOR . get_include_path());
include "index.php";
__HALT_COMPILER();
STUB;
$phar = new Phar('archive.phar');
$phar->addFromString('index.php', '<?php echo "Hello World" .
PHP_EOL;');
$phar->setStub($stub);
```
Then executing the following code:
```php
<?php
var_dump(is_readable('/path/to/archive.phar/index.php'));
```
Resulted in this output:
```
bool(false)
```
But I expected this output instead:
```
bool(true)
```
This also happens for calls made from code executed inside the phar.
### PHP Version
PHP 8.0.12
### Operating System
Ubuntu 20.04