Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class foo {
- public function __construct() {
- $this->monkey();
- }
- protected function monkey() {
- echo 'foo';
- }
- }
- class bar extends foo {
- public function __construct() {
- parent::__construct();
- }
- protected function monkey() {
- echo 'bar';
- }
- }
- echo 'Construct foo ' . "\n";
- $foo = new foo();
- echo "\n\n";
- echo 'Construct bar: ' . "\n";
- $bar = new bar();
- echo "\n";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement