Skip to content

Instantly share code, notes, and snippets.

@tomphp
Created July 31, 2013 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomphp/6120625 to your computer and use it in GitHub Desktop.
Save tomphp/6120625 to your computer and use it in GitHub Desktop.
<?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