💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
* 用途 获取类的新实例和单实例 * 定义 ~~~ trait InstanceTrait { /** * 获取实例 * * @return self */ public static function getInstance() { return new static(); } /** * 获取单实例 * * @return self */ public static function getSingleton() { static $instance = null; if (! isset($instance)) { $instance = self::getInstance(); } return $instance; } } ~~~