Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- abstract class A
- {
- protected static $something;
- abstract static function init();
- static function doSomeWork() {
- echo static::$something;
- }
- }
- class B extends A
- {
- static function init() {
- static::$something = 'something else';
- }
- }
- // hiding implementation detail; may be DIC or something else
- class_alias('A', 'OurImplementation');
- OurImplementation::init();
- OurImplementation::doSomeWork();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement