public static function getInstance(Wee $wee, $template, $config = []) { $hash = md5($wee->filename() . $template . json_encode([$wee->variables(), $config])); if (!isset(self::$instances[$hash])) { $class = get_called_class(); self::$instances[$hash] = new $class($wee, $template, $config); } return self::$instances[$hash]; }