title: Why is my basic php class expecting an argument when I instantiate it?
body: myClass(123);
  
      ?>
  
  <p>this works, but returns this warning:</p>
  
  <pre><code>Warning: Missing argument 1 for myClass::myClass()
  </code></pre>
  
  <p>I read in to this, and seems that the constructor is expecting a value, so by adding:</p>
  
  <pre><code>function myClass($input='')
  </code></pre>
  
  <p>the warning is removed, but this seems so unnecessary? </p>
  
  <p>could someone enlighten me as to why it's required to define a value to prevent that warning?</p>
  
  <p>thanks for any pointers</p>