Go right, go left, go right
Code
# Code
```php []
class Solution
{

    /**
     * @param Integer[] $nums
     * @param Integer $k
     * @return Integer
     */
    function maximumOr($nums, $k)
    {
        $len = count($nums);
        $temp = array_fill(0, $len, 0);

        $sum = 0;
        for ($i = 0; $i < $len; $i++) {
            $temp[$i] |= $sum;
            $sum |= $nums[$i];
        }

        $sum = 0;
        for ($i = $len - 1; $i >= 0; $i--) {
            $temp[$i] |= $sum;
            $sum |= $nums[$i];
        }

        $result = 0;

        foreach ($nums as $key => $num) {
            $check = $num << $k;
            $check |= $temp[$key];
            if($check > $result){
                $result = $check;
            }
        }

        return $result;
    }
}
```
['PHP']