Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114618 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 87026 invoked from network); 26 May 2021 13:10:29 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 May 2021 13:10:29 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A4A861804B5 for ; Wed, 26 May 2021 06:22:00 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) (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 ; Wed, 26 May 2021 06:22:00 -0700 (PDT) Received: by mail-ot1-f50.google.com with SMTP id i23-20020a9d68d70000b02902dc19ed4c15so1000177oto.0 for ; Wed, 26 May 2021 06:22:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OfH7c0DiyQ8NQkFF0J1jsJjICI6LS0aQKDps245FtCc=; b=h4L1E6Oj5FsCFsPii350jFks7FLitw4Om8L/4/Y3vIoLR2o0C0xQeHOnj5gAGosVQ3 mt/rsBOLoqPbtpD/WteCFYTCilknnlT+oYxAOOcQPiuiS2qvlFJ16DmSyR+ZsHyHPIVu B7DBpmvY17lgVVbg8ujoPO++qC9Uvsu9y49cLoheEPIKOP9h1mb+RbIu/OifgFaK0pKh 29fZ8NIfmJvQCJ3dZ/eA1BAAJHRAIp8Yb7Nlb6e18a80fdPsOnGk3USItMh02uYdbN7n 0ud0Sz7WfNzlUqcAE4LzlS+vePHK/0Kdz0+Ddfwe9UmMAzPPdUQq/z/I0QQvb5Fpxotu FJ7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OfH7c0DiyQ8NQkFF0J1jsJjICI6LS0aQKDps245FtCc=; b=QTHPHUJ99wEtlc8PKUHXyNvLHSeOjhUwbqppm1Ec+KUx9jKanRggnJtrnlXg5ra/pu 12FDtzpLokUl5nkk/T5ftv0+a0UvaZdxdO8ZVoa5vp6omhqSFEm2lnPxYfUMNQr9Ko23 UByzFYHJsKmY0e2C767oVRfFHlK3nPEeCwCbYMiLR0g+YWFYyuzKJErb8erK7CJ0RN+f rjvBkCMsSvPPyzKMVw1AA759mYbXNPVxXbLreXQ8PmmLPghM/uPNM8V3ReNf5pWu5a+8 RQ5cJomVVlWFt26V/GS3vCD3U6QFq2KRfVQn7z/SpwmOCa6omtjBYza2ShzBCT3zAFMQ sKHw== X-Gm-Message-State: AOAM531XyKJJxxBjGy0HuOFU8yzRD8kYIe/WzsMfKtLqflzh4BSH+YJB sbke9IoCh9KKukEGJ9rvs8bOK9tIpW+WHXgsFVE= X-Google-Smtp-Source: ABdhPJz5SFi4b/dEatHrW8+yuKl+CicUc5ZaLBdd60IAvYBbt/P0SaOAIVajqHn5R1aFQN8vjfE6sMRRUDQJ4CXEYfQ= X-Received: by 2002:a9d:7d12:: with SMTP id v18mr2326787otn.221.1622035318886; Wed, 26 May 2021 06:21:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 26 May 2021 15:21:47 +0200 Message-ID: To: =?UTF-8?Q?Micha=C5=82_Marcin_Brzuchalski?= Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000fed3be05c33b8614" Subject: Re: [PHP-DEV] Consensus Gathering: is_initialized From: krakjoe@gmail.com (Joe Watkins) --000000000000fed3be05c33b8614 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks Michal for input ... > Ack, but real-world impact seems irrelevant? I've worked on stuff that heavily relies on checking initialized state, and most of it is mostly unaffected. "meaningful benchmark" means "here's a use-case that really needs `is_initialized()`, and absolutely cannot run into the penalties of `ReflectionProperty#isInitialized()` So what I hear you saying is that perf is actually irrelevant regardless of what kind of benchmark you want to do ... > Sounds weird? Why would a narrower version be needed at all? The pattern ReflectionProperty#isInitialized() doesn't allow you to access inaccessible properties without first setting them accessible, so that part is not really different. The scope could be extended to include untyped properties, but extending as far as dynamic properties makes no sense because there's not going to be a significant advantage - it would be doing the same work in the same way as Reflector::IsInitialized. I thought keeping scope as narrow as possible was better, but I can have my mind changed on untyped properties, if that would make the difference between you saying it's good or bad. FWIW I've pretty much talked myself out of it at this point already ... I'm hearing what I expected to hear. Cheers Joe On Wed, 26 May 2021 at 14:57, Micha=C5=82 Marcin Brzuchalski < michal.brzuchalski@gmail.com> wrote: > > > =C5=9Br., 26 maj 2021 o 12:14 Joe Watkins napisa=C5=82(= a): > >> Hi internals, >> >> In response to: https://bugs.php.net/bug.php?id=3D78480 >> >> I implemented: https://github.com/php/php-src/pull/7029 >> >> Not absolutely convinced that it's a good idea, I asked Nikita to review= , >> and he's unconvinced also and suggested a discussion should be started. >> >> You can read both of our thoughts about it on the PR. >> >> What I'm looking for now, is reasons that we are wrong - good use cases >> that aren't born from code that is doing bad things ... >> > > IMHO we don't need it, working with the typed properties since the > beginning > I thought only for a short period that I'd need this kind of feature but > shortly realized > that I'm doing it wrong if my code can reach such state, > given that all paths now lead to a known state, > object construction in all cases specifies all required properties > without having any doubts like uninitialized properties so this is doable= . > > If one really needs to check if a property is initialized or not I > consider it a dark magic > and such can reach up to the reflection mechanism to just check it. > IMHO it's not common (or at least should not be) to have such a need. > > Cheers, > Micha=C5=82 Marcin Brzuchalski > --000000000000fed3be05c33b8614--