facebook / facebook/hhvm

HHVM doesn't handle file:// scheme in local file IO functions

Open
#6,360 2 comments 0 reactions 0 assignees View on GitHub
php5 incompatibility
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

Given the following test code:

``` php
$tmp = sys_get_temp_dir();

$file = rtrim("file://$tmp", '/').'/tmp-file';

var_dump(file_exists($file));

touch($file);

var_dump(file_exists($file));

unlink($file);
```

When running through PHP, I get the following results:

``` bash
bool(false)
bool(true)
```

But running through HHVM I get the following:

``` bash
bool(false)

Warning: touch(): Unable to create file /Library/WebServer/Documents/test/file:/var/folders/jb/7wkf3k716b1d9tc4xxxhr4t40000gn/T/tmp-file because No such file or directory in /Library/WebServer/Documents/test/test.php on line 9
bool(false)

Warning: unlink(file:///var/folders/jb/7wkf3k716b1d9tc4xxxhr4t40000gn/T/tmp-file): No such file or directory in /Library/WebServer/Documents/test/test.php on line 13
```

This works correctly if I remove the `file://` scheme from that path

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.