title: Is it necessary to Initialize / Declare variable in PHP?
body: <p>Is it necessary to initialize / declare a variable before a loop or a function?</p>
  <p>Whether I initialize / declare variable before or not my code still works.</p>
  <p>I'm sharing demo code for what I actually mean:</p>
  <pre><code>$cars = null;
  
  foreach ($build as $brand) {
       $cars .= $brand . &quot;,&quot;;
  }
  
  echo $cars;
  </code></pre>
  <p>Or</p>
  <pre><code>foreach ($build as $brand) {
       $cars .= $brand . &quot;,&quot;;
  }
  
  echo $cars;
  </code></pre>
  <p>Both pieces of code works same for me, so is it necessary to initialize / declare a variable at the beginning?</p>