note 101009 deleted from language.oop5.decon by cmb
| From: | cmb@php.net | Date: | Mon, 07 Sep 2015 21:25:47 +0000 |
| Subject: | note 101009 deleted from language.oop5.decon by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-203733@lists.php.net to get a copy of this message | ||
Note Submitter: gratcypalma at gmail dot com
----
here is my multiple constructor.
<?php
class foo {
protected $mam = 'mamam';
function __construct() {
echo 'foo';
}
}
class bar extends foo {
function __construct() {
parent:: __construct(); // use parent method to call parent class
echo 'bar';
}
}
class foobar extends bar {
function __construct() {
parent:: __construct();
echo 'foobar';
}
}
$show = new foobar();
/* result is foobarfoobar */
?>