Created
July 31, 2013 09:16
-
-
Save tomphp/6120625 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 BaseClass | |
{ | |
private $var; | |
public function __construct($injector) | |
{ | |
$this->var = $injector; | |
} | |
public function show() | |
{ | |
echo $this->var; | |
} | |
} | |
class InjectorBlocker extends BaseClass | |
{ | |
public function __construct() | |
{ | |
parent::__construct('blocked'); | |
} | |
} | |
class GetInjectorBack extends InjectorBlocker | |
{ | |
public function __construct($injector) | |
{ | |
BaseClass::__construct($injector); | |
} | |
} | |
$object = new GetInjectorBack('it works'); | |
$object->show(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment