title: PHP switch statement inside another switch statement
body: <p>I have this situation where I have to check two GET variables. After checking the first one in one switch statement inside the statement, the second variable has to be checked in the second switch statement inside the first one case loop.</p>
  
  <p>I can't post the exact code here, but here is an example:</p>
  
  <pre><code>&lt;?php
      error_reporting(E_ALL);
      ini_set('display_errors', '1');
  
      switch($_GET['parent']){
          case 'child1':
              if(!isset($_GET['child'])){
                  echo "Only parent";
              }
              else{
                  switch($_GET['child']){
                      case 'test':
                          echo 'test';
                          break;
                  }
              }
              break;
  
          case 'child2':
              echo 'child2';
              break;
  
          default:
              echo $_GET['parent'];
      }
  ?&gt;
  </code></pre>
  
  <p>It's working fine with this code example, but when I actually use this procedure on my server, the control get skipped to default at parent switch statement even though it has a matching case value.</p>
  
  <p>No error is reported, and I couldn't debug more than to this level.</p>
  
  <p>I know you want to see the code, but I cannot post it here. At least you can guide me debug more.</p>