title: Is exit needed after return inside a php function?
body: <pre><code>&lt;?php
  
  function testEnd($x) {
      if ( ctype_digit($x) ) {
          if ( $x == 24 ) {
              return true;
              exit;
          } else {
              return false;
                   exit;
          }
      } else {
          echo 'If its not a digit, you\'ll see me.';
          return false;
          exit;
      }
  }
  
  $a = '2';
  
  if ( testEnd($a) ) {
      echo 'This is a digit';
  } else {
      echo 'No digit found';
  }
  ?&gt;
  </code></pre>
  
  <p>Is exit needed along with return when using them inside a php function? In this case, if anything evaluated to false, i'd like to end there and exit.</p>