/** * Get all entries * @return array */ public static function getAll() { return self::$registry; } /** * Overwrite all entries with the provided array * of keys => objects * * @param $registry array */ public static function setAll($registry) { self::$registry = $registry; } } class Helper { public function help() { } } // init Registry::setAll(array('helper' => new Helper())); // time for ($j = 0; $j < $___opts['m']; $j++) { Registry::$registry['helper']->help(); }
* @return array */ public static function getAll() { return self::$registry; } /** * Overwrite all entries in the with the provided array * of keys => objects * * @param $registry array */ public static function setAll($registry) { self::$registry = $registry; } } class Helper { public function help() { } } // init Registry::setAll(array()); /* clear */ Registry('helper', new Helper()); // time for ($j = 0; $j < $___opts['m']; $j++) { Registry('helper')->help(); }