title: yii ajax response right syntax
body: <p>I have action for <strong>AJAX</strong> request  in <strong>YII</strong>:</p>
  
  <pre><code>public function actionSomeCheck()
  {
      if($_GET['foo'] == 'bar')
      {
          echo CJSON::encode(array('status'=&gt;'ok'));
      }
  
      echo CJSON::encode(array('status'=&gt;'error'));
  }
  </code></pre>
  
  <p>I need to add brakes after response generated, but didn't find right syntax.</p>
  
  <p>It can be:</p>
  
  <pre><code>public function actionSomeCheck()
  {
      if($_GET['foo'] == 'bar')
      {
          echo CJSON::encode(array('status'=&gt;'ok'));
          die();// Or exit
      }
  
      echo CJSON::encode(array('status'=&gt;'error'));
      die();
  }
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>public function actionSomeCheck()
  {
      if($_GET['foo'] == 'bar')
      {
          echo CJSON::encode(array('status'=&gt;'ok'));
          return false;
      }
  
      echo CJSON::encode(array('status'=&gt;'error'));
      return false;
  }
  </code></pre>
  
  <p>or without any break after last respone.</p>
  
  <p>Probably with <strong>die/exit</strong> it will return response faster, but can prevent some actions.</p>
  
  <p>It's not a matter of life and death, but want to understand right syntax, as I'll use it very often.</p>