title: Using a constant in a PHP switch in PHP 5.5.9
body: <p>After installing PHP 5.5.9 on <a href="https://en.wikipedia.org/wiki/Ubuntu_version_history#Ubuntu_14.04_LTS_.28Trusty_Tahr.29" rel="nofollow noreferrer">Ubuntu&nbsp;14.04</a> (Trusty Tahr), I found this strange behavior with a <code>switch</code> statement and the <code>PHP_OS</code> constant.</p>
  
  <p>I presume that in PHP 5.5.9 the switch statement is also checking for the same type (===)?</p>
  
  <p>Or is it a PHP bug?</p>
  
  <pre><code>echo PHP_OS; // Linux
  $os = PHP_OS;
  
  switch (PHP_OS) {
      case "WINNT":
          echo 'Windows';
          break;
      case "Linux":
          echo 'Linux';
          break;
      default:
          echo 'Default';
          break;
  }
  // Default
  
  switch ((string) PHP_OS) {
      case "WINNT":
          echo 'Windows';
          break;
      case "Linux":
          echo 'Linux';
          break;
      default:
          echo 'Default';
          break;
  }
  // Default
  
  switch ($os) {
      case "WINNT":
          echo 'Windows';
          break;
      case "Linux":
          echo 'Linux';
          break;
      default:
          echo 'Default';
          break;
  }
  // Linux
  </code></pre>