fwrite vs fputs in php
So far all the functions have been running fast anyway so the difference haven’t been that significant but things are starting to get interesting with the run time jumping to 20-24 microseconds to write a short string to a file.
fwrite vs fputs
fwrite: 24.9826359749 seconds
fputs: 20.1990799904 seconds
Time saved: 4.7835559845 seconds; 23.6820488199%
With a difference of over 4 microseconds you could run both fputs and floatval in the time it takes to run fwrite. The difference is over 23% which clearly makes fputs the better function. It’s shorter as well.
Tags: Anyway, difference, File, functions, interesting, microseconds, running, shorter, significant