|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78575 copy() always report an error with a custom stream wrapper
Submitted: 2019-09-20 13:02 UTC Modified: 2019-10-30 10:32 UTC
Avg. Score:4.0 ± 0.6
Reproduced:5 of 5 (100.0%)
Same Version:5 (100.0%)
Same OS:4 (80.0%)
From: thomas dot gerbet at enalean dot com Assigned: nikic (profile)
Status: Closed Package: Streams related
PHP Version: 7.4.0RC2 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
41 + 44 = ?
Subscribe to this entry?

 [2019-09-20 13:02 UTC] thomas dot gerbet at enalean dot com
Issue found while using the vfsStream library [0]. copy() always return false even if the data are actually copied.

This behaviour change seems to be present since


Test script:

// See

require_once __DIR__ . '/vendor/autoload.php';

$fs = org\bovigo\vfs\vfsStream::setup();
$source_path = $fs->url() . '/f1';
file_put_contents($source_path, 'A');
$destination_path = $fs->url() . '/f2';
var_dump(copy($source_path, $destination_path));

Expected result:
string(1) "A"

Actual result:
string(1) "A"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-10-30 10:25 UTC]
copy() reports an error because a stream_read() call reported an error by returning false. Possibly something in the implementation needs to be adjusted to return "" instead of false on EOF?
 [2019-10-30 10:28 UTC]
Looks like that's indeed the case, and the issue has been recently fixed:

Possibly we need to mention this potential issue in UPGRADING.
 [2019-10-30 10:32 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Mar 05 14:01:23 2021 UTC