Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114634 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 84712 invoked from network); 27 May 2021 11:56:13 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 May 2021 11:56:13 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A875C1804B0 for ; Thu, 27 May 2021 05:07:58 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,SPF_NONE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from processus.org (ns366368.ip-94-23-14.eu [94.23.14.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 27 May 2021 05:07:57 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by processus.org (Postfix) with ESMTPA id E8B365101324; Thu, 27 May 2021 12:07:55 +0000 (UTC) To: Marco Pivetta Cc: =?UTF-8?Q?Micha=c5=82_Marcin_Brzuchalski?= , Guilliam Xavier , Larry Garfield , php internals References: <80fb5a8e-d770-49fd-45d5-ea6f4b004513@gmail.com> <2874cf7c-e55d-4100-bb01-af11a5ab6e87@www.fastmail.com> <93bee614-8bca-7e35-94a6-518beafac8ba@processus.org> Message-ID: Date: Thu, 27 May 2021 14:07:55 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Authentication-Results: processus.org; auth=pass smtp.auth=pierre-php@processus.org smtp.mailfrom=pierre-php@processus.org X-Spamd-Bar: / Subject: Re: [PHP-DEV] Consensus Gathering: is_initialized From: pierre-php@processus.org (Pierre) Le 27/05/2021 à 13:42, Marco Pivetta a écrit : > On Thu, May 27, 2021 at 1:29 PM Pierre wrote: > >> why not having it ? >> > More API, similar-but-not-exactly-like `ReflectionProperty#isInitialized()` > > Minimalims should really be valued more :D I agree and disagree at the same time. I agree because my absolute opinion is the same as yours, but I disagree because my pragmatism is not all about being an idealist, having an is_initialized() could probably allow the compiler to have a specialized opcode, and make this call much much faster than using the reflection in userland (I'm only guessing, but I think it probably would allow that). So, if it's going to be used and abused in those magic APIs we all use daily without thinking about it (let's say, hydrators or serializers, dependency injection containers and all that stuff, and you do maintain some if I recall) and unlock some performance optimizations in there, I'd say go for it. Regards, -- Pierre