Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124572 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 4B6981A00B7 for ; Wed, 24 Jul 2024 14:03:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1721829875; bh=1GMXnRYga0XC3dXzNGu9wWwyYYGMJC476I3YWXJWbIw=; h=In-Reply-To:References:Date:From:To:Subject:From; b=UPzKnOZuJUctsdwM5nyvGR+UwFjpH8zmqgW89GLgXaMnVv6ejNpq+4g9HeudbAmvl Xbhc5T/594L2DTp6vUjg8I0JbzBl17L888XBst7GPR09A+DHBmvX/cTyfy5aZtuCGV cXVlLOdUx2aPylquPSSrmWZ0ovUbxWtCztnsmwxSGN3D0BNJtU8zwLK/qKtUyjhkqO G+EHRwHmiu2v5a8y83eHY7H59VAxoFBfxZn2tw5wQ6C0owaV7Z0NbAh830z0GKZZWe B8ynnfVwmuDibWIZRANFEX+qGvtjkKDT9ZURuGHnpM+JPc1rMzS5ToksedSk87vaYZ xJzi9LHc8LeMA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 28FA918006F for ; Wed, 24 Jul 2024 14:04:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fhigh4-smtp.messagingengine.com (fhigh4-smtp.messagingengine.com [103.168.172.155]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 24 Jul 2024 14:04:33 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailfhigh.nyi.internal (Postfix) with ESMTP id AFAD711401B5 for ; Wed, 24 Jul 2024 10:02:58 -0400 (EDT) Received: from wimap23 ([10.202.2.83]) by compute3.internal (MEProxy); Wed, 24 Jul 2024 10:02:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm3; t=1721829778; x=1721916178; bh=D13yGYnefaKIwKyRgy5XH vzk6gyuGWBkcY152wqbUV8=; b=yBG6PGOB73YNQZTK0bxwX38rF6qElIOHXfR19 lm0iYE1HK1kuFAteE/TlXcSLWBklSUXIRDKJ8gXAuC3Wtpo/DPrnAjcucP+zNL8u jxb6xCfDtcwhk34k+++3fEXFFa74kEE+/WkRAdTLy6y1YyF+osWs8EF91hPoqAz8 o+mHwR2xOhiyzViRzySQxAb27I3sUlpqi7ADt6YKJ6RwKm2FGAgPAa6OR0dEQy07 MzEVe1TpsT8OYBF2MfXtQZIQ8sZNTOImqzPJmWmcC6L23IZNecsPkMKOrvQMvrFN SuH+TIy+ZuWsYgl+SKZ3FzcIn48qqudU8TZlnvp20W5R/ddLQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1721829778; x= 1721916178; bh=D13yGYnefaKIwKyRgy5XHvzk6gyuGWBkcY152wqbUV8=; b=L GXXUo1QDgoxDM3LRTOYYgJh7WgAmcp9fRz770kCmBczwZD3GGrv/KVTBXENfEB7H GtBKSMT0gDhtTpNJOa5T+aXi6BQi6ghs5470Ol2/zivDjqn1nSfRu8eM2Nl57wLT AXQXkO6REO4ePfJqkJxEUfOC+bcJY6temITmFKik08PVLH/pey+nTl7jeGTXTHKa 5gZOrlh7kZZe5HYj51KxP+oyOmDKVgptmVS0CQD4iVS0nFzVXupK4mXa7MP3rBTW MuRfRpelAWNsPYc8+4lD4ooFHsaUSVSNw2z3V22Hh7jURk6zUl/jD6FolRRrJgOm bL9bcRnB6enj32RYbMwTg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddriedugdejvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtgfesthhqredtreerjeenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeffffffjeffudfggeevvdeitdetvdfgjefffeffjeel feejteevheeghffhvdfgleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomhdpnhgspghr tghpthhtoheptd X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id C8FD02920063; Wed, 24 Jul 2024 10:02:57 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-582-g5a02f8850-fm-20240719.002-g5a02f885 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Message-ID: <2fd6d80d-a55c-4aad-aeee-6d07d4b930a1@app.fastmail.com> In-Reply-To: References: <1118bbcd-a7b4-47bf-bf35-1a36ab4628e1@bastelstu.be> <45847b93-02bf-459f-bcd2-81ba35a12c24@bastelstu.be> <46bd4098-2936-4e46-98e9-fe55118325c2@bastelstu.be> <61ab36bc-b045-452a-84e0-87367d4c680e@bastelstu.be> <07e065f2-8f64-4bad-9a98-51f4eaf63ddb@app.fastmail.com> <2a0a4650-c2c5-4c6d-ad3a-25365b3391b2@bastelstu.be> Date: Wed, 24 Jul 2024 14:02:31 +0000 To: "php internals" Subject: Re: [PHP-DEV] [RFC] Lazy Objects Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Thu, Jul 18, 2024, at 7:12 AM, Nicolas Grekas wrote: >> Otherwise, I'm quite looking forward to this. > > =F0=9F=A4=9E Another thought that occurred to me. Given how lightweight it *looks* t= o be (may not actually be, but looks it), how much overhead would there = be to having a compiled DI container that is lazy by default? Just make= everything lazy with a fairly standard initializer or factory, unless a= specific case says you shouldn't. That way you can use optional depend= encies in a constructor pretty much at will with no overhead of needing = to create a chain of dependencies as a result. Would that be a bad idea for some reason, or would it actually work? (This doesn't really affect my vote, more just a thought that came up.) --Larry Garfield