I have a question. I have some experience with OOP, but I am new to PHP(OOP). I am trying to learn it. Is it possible to overload a constructor?
In other languages it's possible to overload the constructor but in php not? I tried but my I got the following message from my IDE: "method with same name already defined in this class"
class testClass{
public $param1 = "";
public $param2 = "";
public function __construct($param1, $param2){
$this->param1 = $param1;
$this->param2 = $param2;
}
public function __construct($param1){
$this->param1 = $param1;
//ToDO use function to set param2
}
}