title: Constructor Overloading in PHP
body: <h2>Problem Approch</h2>
  
  <p>I have a class like this with a overloaded <strong>constructors</strong> </p>
  
  <h2>Code</h2>
  
  <pre><code>&lt;?php 
  /*
    Users Abstract Class
  
  */
  abstract class User 
  {
  
      protected $user_email;
      protected $user_username;
      protected $user_password;
      protected $registred_date;
  
  
      //Default constructor
      function User()
      {
  
      }
  
      //overloded constructor
      function User($input_username,$input_email,$input_password)
      {
      __set($this-&gt;user_username,$input_username);
      __set($this-&gt;user_email,$user_password);
      __set($this-&gt;user_password,$input_password);
      }
  
  }
  
  
  ?&gt;
  </code></pre>
  
  <h2>Problem Details</h2>
  
  <p>Above code provides an error : <code>error:Fatal error: Cannot redeclare User::User()</code></p>
  
  <p>As other languages such as C++ and Java uses the above approach to overload the constructors how to do it in <strong>PHP OOP</strong> ? </p>
  
  <h2>Additional Information</h2>
  
  <p>Im using *<em>PHP 5.3.2 in LAMP *</em> which OOP concepts should fully supported in this version</p>