1--TEST-- 2Test copy() function: usage variations - identical names 3--FILE-- 4<?php 5/* Prototype: bool copy ( string $source, string $dest ); 6 Description: Makes a copy of the file source to dest. 7 Returns TRUE on success or FALSE on failure. 8*/ 9 10/* Test copy(): Try copying source file to desntination file, where destination file name is identical to source name */ 11 12$file_path = dirname(__FILE__); 13 14echo "*** Test copy(): Trying to create a copy of file with the same source name ***\n"; 15$file = $file_path."/copy_variation10.tmp"; 16$file_handle = fopen($file, "w"); 17fwrite($file_handle, str_repeat("Hello2world...\n", 100)); 18fclose($file_handle); 19 20var_dump( copy($file, $file) ); 21var_dump( file_exists($file) ); 22var_dump( filesize($file) ); 23 24echo "*** Done ***\n"; 25?> 26--CLEAN-- 27<?php 28unlink(dirname(__FILE__)."/copy_variation10.tmp"); 29?> 30--EXPECTF-- 31*** Test copy(): Trying to create a copy of file with the same source name *** 32bool(false) 33bool(true) 34int(1500) 35*** Done *** 36