Create vs Copy empty file, which operation is the least expensive?
<p>Which method is least expensive on the server? I am dynamically creating directories and would like each of them to contain an empty html file.  Also how could one measure the difference? </p>

<pre><code>$file = text.html;
$newDest = myDir/text.html;
copy($file, $newDest);
</code></pre>

<p>VS</p>

<pre><code>$File = "myDir/text.html"; 
$Handle = fopen($File, 'w');
$Data = ''; 
fwrite($Handle, $Data);  
print "Data Written"; 
fclose($Handle); 
</code></pre>
