Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- trait A {
- protected static $container = 1;
- public static function setContainer($c){
- self::$container = $c;
- }
- }
- class C{
- use A;
- public function foo(){
- var_dump(self::$container);
- }
- }
- A::setContainer(2);
- $c = new C();
- $c->foo();
Advertisement
Add Comment
Please, Sign In to add comment