title: A function inside an if structure
body: <p>can I put a function in PHP inside a if structure? like this:</p>
  
  <pre><code>&lt;?php
      if(true){
           function HelloWorld(){
               echo "Hello World!!!";
           }
           HelloWorld();
      }
  ?&gt;
  </code></pre>
  
  <p>because I have tried and it works, but I don't know if it is correct or not. Thanks</p>