From: php at lorddeath dot net
Operating system: Win32/Linux
PHP version: 5.3SVN-2010-01-04 (snap)
PHP Bug Type: Filesystem function related
Bug description: copy() with an empty (zero-byte) HTTP source succeeds but
returns false
Description:
------------
The copy() function returns false (but otherwise succeeds in copying the
file) when the source file is accessed via a HTTP stream, but is empty
(zero bytes). Other, non-HTTP, stream types might also be affected, but
local files are definitely *NOT* affected.
I have successfully reproduced this bug with PHP 5.2.9 on Linux, and
5.2.5, 5.2.12, 5.3.0, 5.3.1 and 5.3.3-dev (2010-Jan-04 15:00:00) on
Windows.
(I will keep the empty.txt URL in the reproduce code accessible for a
while.)
Reproduce code:
---------------
$r = copy("http://lspace.sihnon.net/pub/empty.txt", "temp");
var_dump($r);
Expected result:
----------------
bool(true)
Actual result:
--------------
bool(false)
--
Edit bug report at http://bugs.php.net/?id=50657&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=50657&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=50657&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=50657&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=50657&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=50657&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=50657&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=50657&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=50657&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=50657&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=50657&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=50657&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=50657&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=50657&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=50657&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50657&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50657&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=50657&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=50657&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=50657&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=50657&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=50657&r=mysqlcfg