Created
March 12, 2014 11:40
-
-
Save jaytaph/9505214 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class foo { | |
public function f1() { | |
print("F1: ".get_class($this). "\n"); | |
} | |
public function f2() { | |
$this->f1(); | |
} | |
public function f3() { | |
print("F3: ".get_class($this). "\n"); | |
} | |
} | |
class bar extends foo { | |
public function f1() { | |
print("BF1: ".get_class($this). "\n"); | |
$this->f3(); | |
parent::f3(); | |
parent::f1(); | |
} | |
} | |
$b = new bar(); | |
$b->f1(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment