note 76461 deleted from language.oop.constructor by danbrown
| From: | danbrown@php.net | Date: | Sat, 07 Nov 2009 18:57:04 +0000 |
| Subject: | note 76461 deleted from language.oop.constructor by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-162522@lists.php.net to get a copy of this message | ||
Note Submitter: sarjanwebdev at gmail dot com
----
You can use a method of a subclass from a parent class.
class A{
function A(){
$this->say();
}
}
class B extends A{
function say(){
echo "Hi";
}
function B(){
self::A();
}
}
$b=new B();
prints "Hi"