Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123602 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 68C9A1A009C for ; Fri, 14 Jun 2024 13:03:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1718370294; bh=fz/j6AOK6H/0BAYfteRPuNk+mKolmtRxbgxFLDgUkOw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Q9mVYqTxhiXAy4qBfUHQkZX7mxkkzAXU8yzkrjRJPhw0SIqE2bCjJbMlC0DW3D2AX Y1eUMzpLT80f1R0cC2lxOWryqGYPgK666H0aMp76Hy3ACSNzuats8KeGbYXCs7s1KP fnSBkNrdOLJgxLdXYkE5cuV+5W9jh40ZCUen6wbd6SQu+p4iKf7qgGVTRI5im+rV4D UgJy3oCeNu+qbBEQZkIKR1RWcTibYwVV1aXqNjAsbUdMnmJivJetHoWvB+kEHLNUtJ 94P8bIFJbwGn8rqc4gBD7IRdJ9Dmd7OnVbZ7tZ8YR8Rf87WsfdPEZd0g/Jhwvk9mqx my9NnTHB3vggA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 78EE1180041 for ; Fri, 14 Jun 2024 13:04:53 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, 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 mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (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 ; Fri, 14 Jun 2024 13:04:53 +0000 (UTC) Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-57c73a3b3d7so2351608a12.1 for ; Fri, 14 Jun 2024 06:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718370222; x=1718975022; darn=lists.php.net; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=fz/j6AOK6H/0BAYfteRPuNk+mKolmtRxbgxFLDgUkOw=; b=ajgkVWfFwzCwYd6v5OC3Jm0m+1oPAioQTWAP4ER4L/tF3PARSCe+tAHbX+fT7k9UDy 141wNmX2dbKtsDVHeR6B+CdxHC2mH9C3Cwq/b86H5XJSbY48l9nsFea7feT6XCpJ6k9U hQh6m4RElxP41wjOG6o6Pnju2FuTrdXoBD6HM9ZaMACnFvl7Q2OyXSUsOB8tiza4HgT+ DUrueUaxJHn7nGQFwGbFumJLKkW7Kngzjuc0v+ebdneFsLFpHicrAb//jZ5WwSLlfDES KopvDaY8Ac7EdOZuTjMYpg9wqf+HUhmm1RzRJfvXjXnO7z0mbdG0Q8qmVQffW6kcfQhE 1IJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718370222; x=1718975022; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fz/j6AOK6H/0BAYfteRPuNk+mKolmtRxbgxFLDgUkOw=; b=xRS+QI0DRuiAgGwKFS1h2ojd3zHL/l/PhWKoK7Prykenh+kjaHxFqKOu/jte4FcoiV YsR5IGtpY7bJGXN7K7NNOFIRPcfkKWZShOHcJ0bwr09B7QJ69qV/tDm8I8XKfyI7I2t+ hWwo+Rt1pG5Cm2jIwPCWIGhTas4/w/769tpvcsHM8jPpC8aRykYnJ2z3fwTCW/fk8a/Z Ij8xG5mYccJbJwTY5pNZnoI6hdmF1W2EIbFE7IJV4fx8IruEbu1q/H52MFQnltPCfMb1 LASvd3ddyHkHcE1g+HMbJ0UVlKxmOt/6/4J/1yZ2npaNwga3LC/LiLg3/MnYcNmqZUKu 0Ysw== X-Forwarded-Encrypted: i=1; AJvYcCXrvslk3SiO7EmaPT/74JInAK4qORRdDZ0f4+PykzIVySV9L9lG95M0GKUVx6IPfTDuz50jZnMSQh3xKOUOBlj6lGY7Gx/yXg== X-Gm-Message-State: AOJu0YyDMjR4HnPafrkcLZsgbqg+jWRPly8l5Mlfnc2IVsKziLx08xNK WzqkjPeKOIb+4nMUdk14sANvseXNN0sHtoc7O7U63OlHWj+oVBSzLLVnvWwwKvfGlWksZ0trj9a qK+j8lD1osXfgU4BNxMIaKITO0Xk= X-Google-Smtp-Source: AGHT+IEiDrdl08NcYPlypg47u5E3+wegUNljIeA0lrVWNklPy0DlfMKuOZduFi3aH5+9tp5v28b32HfikEq1a2mLsYs= X-Received: by 2002:a17:907:6b86:b0:a6f:6e7e:3495 with SMTP id a640c23a62f3a-a6f6e7e3729mr6869266b.9.1718370221528; Fri, 14 Jun 2024 06:03:41 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 14 Jun 2024 15:03:30 +0200 Message-ID: Subject: Re: [PHP-DEV] [RFC] Lazy Objects To: =?UTF-8?Q?Micha=C5=82_Marcin_Brzuchalski?= , Chris Riley Cc: Larry Garfield , php internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: arnaud.lb@gmail.com (Arnaud Le Blanc) Hi Micha=C5=82, Chris, On Thu, Jun 6, 2024 at 8:53=E2=80=AFAM Micha=C5=82 Marcin Brzuchalski wrote: > Did you consider implementing it using some attribute? On Sun, Jun 9, 2024 at 1:24=E2=80=AFAM Chris Riley wr= ote: > I'm wondering why this has been attached to the existing reflection API i= nstead of being a new thing in and of itself? It doesn't seem strictly rela= ted to reflection other than currently the solutions for this rely on refle= ction to work. Thank you for your feedback. Currently the lazy objects feature is designed as a low-level technical building block that libraries and frameworks can use. FFI and Fibers are examples of such features that most users do not use directly, but can benefit greatly from within libraries they use. We have considered the proposed syntaxes, such as using annotations, but these do not match the core use case of creating a lazy instance of a class without requiring cooperation from the class itself. Furthermore we believe that designing a higher-level API in the language would be considerably more difficult and could put the RFC at risk. However, it is possible to introduce a higher-level way to create lazy objects in a future RFC. Best Regards, Arnaud