/** * Calls the TestStatic object. * * @return mixed The result of the static call. */ public function callStatic() { return TestStatic::test(); }
<?php class TestStatic { public function One($content) { static $context = []; if ($content == 'return') { return $context; } $context[] = $content; } public function tw() { var_dump($this->One('return')); } } $A = new TestStatic(); $A->One('AAAAA'); $B = new TestStatic(); $B->One('BBBBB'); $C = new TestStatic(); $C->One('CCCCC'); $D = new TestStatic(); $D->One('DDDDD'); $E = new TestStatic(); $E->tw();