note 100337 added to function.touch

From: Date: Fri, 08 Oct 2010 21:11:13 +0000
Subject: note 100337 added to function.touch
Groups: php.notes 
Request: Send a blank email to php-notes+get-173090@lists.php.net to get a copy of this message
I has passed a small test to check which function is faster to create a new file. file_put_contents vs touch <?php for($i = 0; $i < 100; $i++) { file_put_contents('dir/file'.$i, ''); } ?> Average time: 0,1145s <?php for($i = 0; $i < 100; $i++) { touch('dir/file'.$i); } ?> Average time: 0,2322s So, file_put_contents is faster than touch, about two times. ---- Server IP: 82.177.164.100 Probable Submitter: 82.160.202.14 ---- Manual Page -- http://www.php.net/manual/en/function.touch.php Edit -- https://master.php.net/note/edit/100337 Del: integrated -- https://master.php.net/note/delete/100337/integrated Del: useless -- https://master.php.net/note/delete/100337/useless Del: bad code -- https://master.php.net/note/delete/100337/bad+code Del: spam -- https://master.php.net/note/delete/100337/spam Del: non-english -- https://master.php.net/note/delete/100337/non-english Del: in docs -- https://master.php.net/note/delete/100337/in+docs Del: other reasons-- https://master.php.net/note/delete/100337 Reject -- https://master.php.net/note/reject/100337 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#173090) next »