title: why does php doesn't go inside catch block without throwing an exception
body: <p>I am new to php, i am from java background, i am wondering why php doesn't goes directly when exception occured in try block without throwing that exception manually.
  e.g.</p>
  
  <pre><code> &lt;?php
  //create function with an exception
  function checkNum($number) {
    if($number/0) {
      throw new Exception("Value must be 1 or below");
    }
    return true;
  }
  
  //trigger exception in a "try" block
  try {
    checkNum(2);
    //If the exception is thrown, this text will not be shown
    echo 'If you see this, the number is 1 or below';
  }
  
  //catch exception
  catch(Exception $e) {
    echo 'Message: ' .$e-&gt;getMessage();
  }
  ?&gt;
  </code></pre>
  
  <p>in above example in if condition the divide by zero exception is occured and then it will directly go to the catch block instead it goes to inside if.why?</p>