python to php conversion
<p>I'm trying to convert parts of a python script into php.  I know most of it, but I've run into something to do with bitshifting (i think?) which I don't have much experience in even in PHP!  Can somebody translate this python function into php please?</p>

<pre><code>def setBit(value, position, on):
    if on:
        mask = 1 &lt;&lt; position
        return (value | mask)
    else:
        mask = ~(1 &lt;&lt; position)
        return (value &amp; mask)    
</code></pre>
