Doc #72900 [Opn->Ver]: stream_copy_to_stream() can also return false
| From: | cmb@php.net | Date: | Fri, 19 Aug 2016 22:35:33 +0000 |
| Subject: | Doc #72900 [Opn->Ver]: stream_copy_to_stream() can also return false | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-13839@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72900&edit=1
ID: 72900
Updated by: cmb@php.net
Reported by: alexxz at alexxz dot ru
-Summary: stream_copy_to_stream function documentaion is
incomplete on return value
+Summary: stream_copy_to_stream() can also return false
-Status: Open
+Status: Verified
Type: Documentation Problem
Package: Streams related
PHP Version: Irrelevant
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2016-08-19 16:58:18] alexxz at alexxz dot ru
Description:
------------
http://php.net/manual/en/function.stream-copy-to-stream.php
Return Values ¶
Returns the total count of bytes copied.
Documentation says function returns int. But in fact it returns false on error.
Test script:
---------------
dd if=/dev/zero of=test bs=1024 count=10000
sudo losetup -f test
sudo mkfs.ext4 /dev/loop0
sudo mount /dev/loop0 /media/alexxz/
sudo chown alexxz /media/alexxz/
/usr/bin/time php -n -r 'var_dump(stream_copy_to_stream(fopen("/dev/zero",
"r"), fopen("/media/alexxz/s", "w")));'
bool(false)
df -h
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72900&edit=1