1--TEST-- 2Test copy() function: usage variations - dir as source (Bug #42111) 3--SKIPIF-- 4<?php 5if(substr(PHP_OS, 0, 3) == "WIN") 6 die("skip Do not run on Windows"); 7?> 8 9--FILE-- 10<?php 11/* Prototype: bool copy ( string $source, string $dest ); 12 Description: Makes a copy of the file source to dest. 13 Returns TRUE on success or FALSE on failure. 14*/ 15 16/* Test copy(): Trying to create a copy of an existing dir */ 17 18$file_path = dirname(__FILE__); 19 20echo "*** Test copy() function: Trying to create a copy of an existing dir ***\n"; 21$src_dir = $file_path."/copy_variation12"; 22mkdir($src_dir); 23 24$dest = $file_path."/copy_copy_variation12"; 25 26var_dump( copy($src_dir, $dest) ); 27 28var_dump( file_exists($dest) ); 29 30var_dump( filesize($src_dir) ); 31var_dump( filesize($dest) ); 32 33echo "*** Done ***\n"; 34?> 35 36--CLEAN-- 37<?php 38rmdir(dirname(__FILE__)."/copy_variation12"); 39?> 40 41--EXPECTF-- 42*** Test copy() function: Trying to create a copy of an existing dir *** 43 44Warning: copy(): The first argument to copy() function cannot be a directory in %scopy_variation12.php on line %d 45bool(false) 46bool(false) 47int(%d) 48 49Warning: filesize(): stat failed for %scopy_copy_variation12 in %scopy_variation12.php on line %d 50bool(false) 51*** Done *** 52