title: if condition changed by its content
body: <p>I encountered relay interesting problem.</p>
  
  <p>I have this condition in external file which is called and after process code redirects to page set via <code>BACKLINK</code> post parameter like this.</p>
  
  <pre><code>if(isset($_POST['secureLogout'])) 
  {
      $_POST['backlink'] = '/';
      session_destroy();
      System::WriteLog('Session has been destroyed');
  } 
  </code></pre>
  
  <p>and even I don't post <code>secureLogout</code> parameter it still trigger, so I tried to <code>var_dump</code> POST variables, there is no <code>secureLogout</code> parameter.</p>
  
  <p>so then I tried put my POST inside condition with exit to see what is in my post..</p>
  
  <pre><code>if(isset($_POST['secureLogout'])) 
  {
      var_dump($_POST); exit();
  
      $_POST['backlink'] = '/';
      session_destroy();
      System::WriteLog('Session has been destroyed');
  } 
  </code></pre>
  
  <p>and NOW magic happens <code>It does not trigger</code>  the code continue and everything works fine, but i cant logout now directly cause of exit before session destroy.</p>
  
  <p>So basically how is it even possible that content inside IF has any effect on condition??</p>
  
  <p>It is completely UN-logical and I lost my patience, I tried change post names, conditions but result is same. </p>
  
  <p>If there is exit inside condition, condition is false, if there is no exit condition is true.</p>
  
  <p><em>EDIT</em></p>
  
  <p>I changed if condition to $_POST['secureLogout'] == 'secureLogout' problem still remained then i changed condition to </p>
  
  <pre><code>$_POST['secureLogout'] == 'secureLogout123'
  </code></pre>
  
  <p>which has to be false everytime and it is session is not destroyed, so I put exit inside again and changed condition back </p>
  
  <pre><code>$_POST['secureLogout'] == 'secureLogout'
  </code></pre>
  
  <p>with exit, condition does not tirgger so $_POST secureLogout parameter is either <strong>different</strong> or is not <strong>set</strong> </p>
  
  <p><strong>I removed exit</strong> and session been destroied...</p>