constructor overloading

May 12, 2011

Constructor Overloading in PHP

There is no simple method of overloading constructors in PHP. There are few workarounds to achieve this. I use the following technique. class UserIdentity extends CUserIdentity { public function __construct() { $arg_list = func_get_args(); switch(func_num_args()) { case 1: // calling […]
Constructor Overloading in PHP
This website uses cookies to provide necessary website functionality, improve your experience and analyze our traffic. By using our website, you agree to our Privacy Policy and our cookies usage.
READ MORE