[php-src] Issue #9653: copy() target is blank in PHP 8.2.0-rc3
| From: | pesselbach | Date: | Sat, 01 Oct 2022 15:39:25 +0000 |
| Subject: | [php-src] Issue #9653: copy() target is blank in PHP 8.2.0-rc3 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-242507@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/9653
Author: pesselbach
### Description
The following code:
```php
<?php
copy("test.txt", "testcopy.txt");
```
Resulted in this output:
testcopy.txt is an empty 0 bytes file.
But I expected this output instead:
testcopy.txt is a copy of test.txt
The following workaround is working:
```php
<?php
file_put_contents("testcopy.txt", file_get_contents("test.txt"));
```
This problem exists at least since PHP 8.2.0-rc1. Production versions such as PHP 8.1.11 are working
as expected. I am using Debian 10 with the packages provided by https://deb.sury.org running in a VirtualBox machine.
### PHP Version
PHP 8.2.0-rc3
### Operating System
Debian 10