Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123608 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 5E78C1A009C for ; Fri, 14 Jun 2024 20:26:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1718396843; bh=o70FDlM4l59LqVJexA9lq5y8+lPMmc2OtpEqPJKGcB8=; h=In-Reply-To:References:Date:From:To:Subject:From; b=lFCO1IUvpYkOtl8Na1xAuI3qLzTkDvPBrjZrBpGmE/lRb2u7DJNhgSCIRfZY6TJVU drQa9OnsyNTqCZG9kx+hn7C0fduQSHfsridURZUxk//TRfpikhsEH7SMe6x+8Ws7nK apBC0JofXWbbz891c3Q7WcJbSCvl5fby0fyPrV9zKLCAQlezwUvnlkm5Ty4FFX7Yy1 a2Bb2Jd2PxJS+WiLDGjTXjLPTxIFXst2AsFAO4GyeFvBKijQI2s8pZmi7tgpvjzSrd Q0VY5QEL4d2yz5qKJnF40beSMfcHiYLoh/McwC68dUjvcmAwwSdFUlVhZOUQqPI2fv R1xq4vCPhczWw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BFF3518005D for ; Fri, 14 Jun 2024 20:27:22 +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,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fout2-smtp.messagingengine.com (fout2-smtp.messagingengine.com [103.168.172.145]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 14 Jun 2024 20:27:22 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id C31181380154 for ; Fri, 14 Jun 2024 16:26:11 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Fri, 14 Jun 2024 16:26:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc: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=fm1; t=1718396771; x= 1718483171; bh=j8BirIzJvqHHb72sLI33WNgUuSHHh1c6HV103ag4pVY=; b=f pJcME9VlgPAUB/IIR2pEY8x+rghVB8zyIO6HjTohNesCzmExj3/W63Vjnv7MX3Xu JiqEuQy+dBRPFc1bk64e+sKw4s/AT/guA2vPGF8oEx1N07p/cBS6HJUBGBxiNaGC /UEqJtdneaUvvb9Z+7S7Ud8mgt6qMtuGweFCW5oSLDbcXgZpQcnDIWFVIWNx7qlD qDj0k0D13yTG0+UpY9QN61DcUN/nkf6kl183umw/B58cwoxx6jE+5LSl5aYMV39p UXCnwJnNtp4CPqZaPBGzu8yVveYPPvqMeI+FOFb23Eb7+PsvbiFqtdzKMLPYCbOk bbdm6TUkCSP+BZZJYiEpA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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= fm1; t=1718396771; x=1718483171; bh=j8BirIzJvqHHb72sLI33WNgUuSHH h1c6HV103ag4pVY=; b=BwzhLAEO+j/Mis9zDYty6E99HRTQTt5f+9RCW2PNaHuq Q+oG+9KWSDeadSPiRZ/ljhwKqrCjIyEOxKmuwQPByGK12dL4btEns6+KIQOdAJyC RPjtU1+/M06j/PGupDk+GWIK3gXouxzYkyZ/8w/kNLLlBGYZGA+MdQe2LLmvdc+8 AQC+0XpW0UlMEylD7ta420vIkBJL8GTqX4yb5/6jsJInp2Yn0WJgcjoyI0rqm+ta B4J4N2kX674NgGDhjHOBV5kUXTUUM9MdY2D44n6YhjEaBr4833wBTGK6n9SRHAHO ubvoCqrexAEHR4DM93NiUMV3gTiu2Ru4/RHtJoSUjA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeduledgudegkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfnfgr rhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homheqnecuggftrfgrthhtvghrnhepgeelgfekudeivddvteffueejffdthfejieevhefg ffekudevkedtvdelvddvffefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 77E501700093; Fri, 14 Jun 2024 16:26:11 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-515-g87b2bad5a-fm-20240604.001-g87b2bad5 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Message-ID: <188bdc24-141c-46e8-bd32-b33f08534983@app.fastmail.com> In-Reply-To: References: <1118bbcd-a7b4-47bf-bf35-1a36ab4628e1@bastelstu.be> Date: Fri, 14 Jun 2024 20:25:50 +0000 To: "php internals" Subject: Re: [PHP-DEV] [RFC] Lazy Objects Content-Type: text/plain From: larry@garfieldtech.com ("Larry Garfield") On Fri, Jun 14, 2024, at 8:15 PM, Larry Garfield wrote: And of course I got the code sample wrong. It should be: > class Service { > public function __construct(private ServiceA $a, private ServiceB $b) {} > } > > $c = some_container(); > > $init = fn() => $this->__construct($c->get(ServiceA::class), > $c->get(ServiceB::class)); > > $service = new ReflectionLazyObjectFactory(Service::class)->newGhostInstance(init); Sorry about that. --Larry Garfield