php.net |  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: -
Votes:4
Avg. Score:4.0 ± 0.7
Reproduced:4 of 4 (100.0%)
Same Version:4 (100.0%)
Same OS:3 (75.0%)
From: thomas dot gerbet at enalean dot com Assigned:
Status: Open Package: Streams related
PHP Version: 7.4.0RC2 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-09-20 13:02 UTC] thomas dot gerbet at enalean dot com
Description:
------------
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 https://github.com/php/php-src/commit/11f3e24190fa45689c8ccaeea54a28db6752092e


[0] https://github.com/bovigo/vfsStream

Test script:
---------------
<?php

// See https://github.com/LeSuisse/php74-rc2-streamwrapper-bug

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));
var_dump(file_get_contents($destination_path));

Expected result:
----------------
bool(true)
string(1) "A"

Actual result:
--------------
bool(false)
string(1) "A"

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Oct 17 06:01:27 2019 UTC