OOP: __construct() and "extend"
| From: | APseudoUtopia | Date: | Tue, 22 Dec 2009 22:45:49 +0000 |
| Subject: | OOP: __construct() and "extend" | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-300636@lists.php.net to get a copy of this message | ||
Hey list,
I'm writing my own class which extends upon the Memcached class
(php.net/memcached).
I'm a bit confused as to how the constructor works when extending a class.
class caching extends Memcached {
function __construct() {
echo "Caching Class Construct!";
}
}
For something like the above code, is the Memcached constructor
called? Or do I have to explicitly call it via parent::__construct()
within the caching class?
Thanks.