Re: class constructor overloading

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2008/10/23 Alain Roger <raf.news@xxxxxxxxx>:

> is it possible to overload the class construct(or) ?
> if yes, how ?

class A
{
	function __construct()
	{
		echo "A";
	}
}

class B extends A
{
	function __construct()
	{
		echo "B";
		parent::__construct();
	}
}

$B = new B();

-- 

http://www.otton.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux