|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-07-13 12:00 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 21:00:01 2025 UTC |
Description: ------------ stream_copy_to_stream() returns 0 when maxlength is bigger then the actual length. But copying is ok. Reproduce code: --------------- $src = fopen('http://www.php.net', 'r'); $dest = fopen('ok.txt', 'w'); echo stream_copy_to_stream($src, $dest) . " bytes copied\n"; fclose($src); fclose($dest); $src = fopen('http://www.php.net', 'r'); $dest = fopen('BUG.txt', 'w'); echo stream_copy_to_stream($src, $dest, 100000) . " bytes copied\n"; // returns zero fclose($src); fclose($dest); echo filesize('ok.txt')."\n"; echo filesize('BUG.txt')."\n"; Expected result: ---------------- 39821 bytes copied 39821 bytes copied 39821 39821 Actual result: -------------- 39821 bytes copied 0 bytes copied 39821 39821