note 105421 added to function.file-put-contents
| From: | justin dot carlson at gmail dot com | Date: | Tue, 16 Aug 2011 15:28:26 +0000 |
| Subject: | note 105421 added to function.file-put-contents | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-182514@lists.php.net to get a copy of this message | ||
It should be obvious that this should only be used if you're making one write, if you are
writing multiple times to the same file you should handle it yourself with fopen and fwrite, the
fclose when you are done writing.
Benchmark below:
file_put_contents() for 1,000,000 writes - average of 3 benchmarks:
real 0m3.932s
user 0m2.487s
sys 0m1.437s
fopen() fwrite() for 1,000,000 writes, fclose() - average of 3 benchmarks:
real 0m2.265s
user 0m1.819s
sys 0m0.445s
----
Server IP: 69.147.83.197
Probable Submitter: 173.45.226.252 (proxied: 127.0.0.1)
----
Manual Page -- http://www.php.net/manual/en/function.file-put-contents.php
Edit -- https://master.php.net/note/edit/105421
Del: integrated -- https://master.php.net/note/delete/105421/integrated
Del: useless -- https://master.php.net/note/delete/105421/useless
Del: bad code -- https://master.php.net/note/delete/105421/bad+code
Del: spam -- https://master.php.net/note/delete/105421/spam
Del: non-english -- https://master.php.net/note/delete/105421/non-english
Del: in docs -- https://master.php.net/note/delete/105421/in+docs
Del: other reasons-- https://master.php.net/note/delete/105421
Reject -- https://master.php.net/note/reject/105421
Search -- https://master.php.net/manage/user-notes.php