如果OR不工作

I have a statement set up to determine whether drupal blocks are present, and give a class depending on how many blocks are available.

<?php if($page['sidebar_first'] || $page['sidebar_second']) { 
      $contentwid= "eleven"; 
 } else { 
      $contentwid= "sixteen"; 
 } ?>

<?php if($page['sidebar_first'] && $page['sidebar_second']) { 
      $contentwid= "seventeen"; 
 } else { 
      $contentwid= "sixteen"; 
 } ?>

<div id="content" class="<?php print $contentwid; ?> columns">
</div>

The second statement works fine, If there is a block in the first sidebar AND a block in the second sidebar, then the main content has a class of seventeen.

The problem is with the first statement for OR ( || ). It doesn't matter if there is a block in either sidebar, the content is always given a class of sixteen, which is full width, and pushes the sidebar content to the bottom.

I know its detecting sidebar blocks correctly because the second statement works perfectly. I have set up everything else correctly, and have traced it back to this OR statement, which always seems to result in FALSE (sixteen).

I've tried || and OR, but as far as I know, they are no different, just user preference right?

I'm stumped.

It's executing the first if (the or) and setting $contentwid correctly, but then it still executes the second if (the and) and failing, so executing the else for that, which resets $contentwid to "sixteen"

<?php if($page['sidebar_first'] || $page['sidebar_second']) { 
      $contentwid= "eleven"; 
 } else { 
      $contentwid= "sixteen"; 
 } elseif($page['sidebar_first'] && $page['sidebar_second']) { 
      $contentwid= "seventeen"; 
 } else { 
      $contentwid= "sixteen"; 
 } ?>

though you might want to reverse the "and" and "or" to prevent the and from failing

 <?php if($page['sidebar_first'] && $page['sidebar_second']) { 
      $contentwid= "seventeen"; 
 } elseif($page['sidebar_first'] || $page['sidebar_second']) { 
      $contentwid= "eleven"; 
 } else { 
      $contentwid= "sixteen"; 
 } ?>