<?php function outputofsomeprocess() { return range('A','E'); } class A{ public static $foo = array (); public static function doSomething(){ //... Do some process and instantiate static vairable $face self::$foo = outputofsomeprocess(); } } class B{ public function dosomethingelse(){ A::doSomething(); } } class C{ public function dosomethingelse(){ echo A::$foo[0]; } } $objB = new B(); $objB-> dosomethingelse(); $objC = new C(); $objC->dosomethingelse();
You have javascript disabled. You will not be able to edit any code.