How can I rewrite this JavaScript to PHP?
<p>Following are some individual JavaScript statements from a block of java-script code. I want to convert this JavaScript code in PHP so that I can execute it server-side. In the following snippet, there are some operators used, such as <code>&gt;&gt;</code>, <code>&gt;&gt;&gt;</code>, <code>~</code>, <code>^</code>, <code>&lt;&lt;</code>, <code>&lt;&lt;&lt;</code>, etc.</p>

<p>How can I translate these JavaScript functions to PHP?</p>

<pre><code>function core_enc(K, F) {
    K[F &gt;&gt; 5] |= 128 &lt;&lt; ((F) %32);
    K[(((F + 64) &gt;&gt;&gt; 9) &lt;&lt; 4) + 14] = F;
}

function enc_ff(C, B, G, F, A, E, D) {
    return enc_cmn((B &amp; G) | ((~B) &amp; F), C, B, A, E, D);
}

function enc_hh(C, B, G, F, A, E, D) {
    return enc_cmn(B ^ G ^ F, C, B, A, E, D);
}

function safe_add(A, D) {
    var C = (A &amp; 65535) + (D &amp; 65535);
    var B = (A &gt;&gt; 16) + (D &gt;&gt; 16) + (C &gt;&gt; 16);
    return (B &lt;&lt; 16) | (C &amp; 65535);
}

function bit_rol(A, B) {
    return (A &lt;&lt; B) | (A &gt;&gt;&gt; (32 - B));
}
</code></pre>
