KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Problem Approch I have a class like this with a overloaded constructors Code <?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->user_username,$input_username); __set($this->user_email,$user_password); __set($this->user_password,$input_password); } } ?> Problem Details Above code provides an error : error:Fatal error: Cannot redeclare User::User() As other languages such as C++ and Java uses the above approach to overload the constructors how to do it in PHP OOP ? Additional Information Im using * PHP 5.3.2 in LAMP * which OOP concepts should fully supported in this version
Tags (comma-separated)
Save Edits
Cancel