It looks like stream_copy_to_stream (at least in PHP 5.1.6 64-bit) does not deallocate buffers while copying.
Just tested it with a 500 MB file and it ate all my memory.
----
Server IP: 217.160.235.204
Probable Submitter: 87.79.193.34
----
Manual Page -- http://www.php.net/manual/en/function.stream-copy-to-stream.php
Edit -- https://master.php.net/note/edit/98118
Del: integrated -- https://master.php.net/note/delete/98118/integrated
Del: useless -- https://master.php.net/note/delete/98118/useless
Del: bad code -- https://master.php.net/note/delete/98118/bad+code
Del: spam -- https://master.php.net/note/delete/98118/spam
Del: non-english -- https://master.php.net/note/delete/98118/non-english
Del: in docs -- https://master.php.net/note/delete/98118/in+docs
Del: other reasons-- https://master.php.net/note/delete/98118
Reject -- https://master.php.net/note/reject/98118
Search -- https://master.php.net/manage/user-notes.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.