src/Leevel/Protocol/Pool.php
public function get(string $className, ...$args)
    {
        $this->valid($className);
        $className = $this->normalize($className);
        $pool = $this->pool($className);

        if ($pool->count()) {
            $obj = $pool->shift();

            if (is_callable([$obj, '__construct'])) {
                $obj->__construct(...$args);
            }

            if (is_callable([$obj, 'construct'])) {
                $obj->construct();
            }

            return $obj;
        }

        return $this->container->make($className, $args);
    }
public function get(string $className, ...$args)
    {
        $this->valid($className);
        $className = $this->normalize($className);
        $pool = $this->pool($className);

        if ($pool->count()) {
            $obj = $pool->shift();

            if (is_callable([$obj, '__construct'])) {
                $obj->__construct(...$args);
            }

            if (is_callable([$obj, 'construct'])) {
                $obj->construct();
            }

            return $obj;
        }

        return $this->container->make($className, $args);
    }
获取一个对象.

@param string $className
@param array  $args

@return \Object