Created
November 18, 2015 20:52
-
-
Save TheFrozenFire/131f11540459160337de to your computer and use it in GitHub Desktop.
This file contains 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 | |
namespace bar; | |
class dependency | |
{ | |
} |
This file contains 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 | |
include __DIR__.'/superclass.php'; | |
include __DIR__.'/subclass.php'; | |
include __DIR__.'/dependency.php'; | |
$a = new foo\subclass; | |
$a->test(); |
This file contains 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 | |
namespace foo; | |
use \bar\dependency; | |
class subclass extends superclass | |
{ | |
public function test() | |
{ | |
$this->execute(); | |
} | |
} |
This file contains 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 | |
namespace foo; | |
class superclass | |
{ | |
protected function execute() | |
{ | |
$a = new dependency; | |
var_dump($a); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment