Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Yes 100% correct</strong> ... that is if you are still using PHP early version of <code>PHP</code> such as <code>PHP 5.1.2</code> to <code>PHP 5.2.2</code> in most resent stable version of <code>PHP</code> they are the same and <code>md5</code> run slightly faster in some versions </p> <p><a href="http://3v4l.org/GDVgk" rel="nofollow">Here is a simple test in most PHP version</a></p> <p>You also need to note that bench mark method is wrong and changing position affect the result ... This is how to get better result .</p> <pre><code>set_time_limit(0); echo "&lt;pre&gt;"; function m1($total) { for($i = 0; $i &lt; $total; $i ++) hash('md5', 'string'); } function m2($total) { for($i = 0; $i &lt; $total; $i ++) md5('string'); } function m3($total) { for($i = 0; $i &lt; $total; $i ++) hash('sha1', 'string'); } function m4($total) { for($i = 0; $i &lt; $total; $i ++) sha1('string'); } function m5($total) { for($i = 0; $i &lt; $total; $i ++) hash('md5', $i); } function m6($total) { for($i = 0; $i &lt; $total; $i ++) md5($i); } function m7($total) { for($i = 0; $i &lt; $total; $i ++) hash('sha1', $i); } function m8($total) { for($i = 0; $i &lt; $total; $i ++) sha1($i); } $result = array( 'm1' =&gt; 0, 'm2' =&gt; 0, 'm3' =&gt; 0, 'm4' =&gt; 0, 'm5' =&gt; 0, 'm6' =&gt; 0, 'm7' =&gt; 0, 'm8' =&gt; 0 ); $total = 10000; for($i = 0; $i &lt; 100; ++ $i) { foreach ( array_keys($result) as $key ) { $alpha = microtime(true); $key($total); $result[$key] += microtime(true) - $alpha; } } echo '&lt;pre&gt;'; echo "Single Run\n"; print_r($result); echo '&lt;/pre&gt;'; </code></pre> <p>Output </p> <pre><code>Single Run Array ( [m1] =&gt; 0.58715152740479 &lt;--- hash/md5/string [m2] =&gt; 0.41520881652832 &lt;--- md5/string [m3] =&gt; 0.79592990875244 &lt;--- hash/sha1/string [m4] =&gt; 0.61766123771667 &lt;--- sha1/string [m5] =&gt; 0.67594528198242 &lt;--- hash/md5/$i [m6] =&gt; 0.51757597923279 &lt;--- md5/$i [m7] =&gt; 0.90692067146301 &lt;--- hash/sha1/$i [m8] =&gt; 0.74792814254761 &lt;--- sha1/$i ) </code></pre> <p><a href="http://codepad.viper-7.com/QxqQvG" rel="nofollow">Live Test</a> </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload