Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115896 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 53068 invoked from network); 30 Aug 2021 12:02:11 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Aug 2021 12:02:11 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 327531804BD for ; Mon, 30 Aug 2021 05:37:40 -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_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (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 ; Mon, 30 Aug 2021 05:37:39 -0700 (PDT) Received: by mail-lf1-f48.google.com with SMTP id b4so30846700lfo.13 for ; Mon, 30 Aug 2021 05:37:39 -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=rf/u1RR7s07PN92ljfIjZPxoqX+0547Nq1CMbNq01NY=; b=MWfVc4uqmYYzJMURo+Yzqa91ZIQmq1YDwJI9JTZgrEaua/AT+QXXxVw4237P760FZo 0vqBzNjBSfVzJwt4EMu/dyXG9P2pLoXsd54cS7JctDeBKyCv7jwFqMJ+cIbA0dsWAcUZ z7sbQ2LZMNOn/6IOjmwpI1HCv8iTVUN89ZO8zjb4IUoQPeEZ4O5GuAoz+z7Ta7mbMEkt XqtlEiHMdnEzPjTTP8ke9MhvoI+TpRbBM6bNssKsnCCG1s5gwm1Gk00JqVY5v7DG5KhQ NzS3p+E+09WpuF5uOsDtJbCGoufWmoLdtXIKRTWUnhHCULFdayp8WJffy0vGx3nZaZdd NZ9g== 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=rf/u1RR7s07PN92ljfIjZPxoqX+0547Nq1CMbNq01NY=; b=OIAw8R5oCXbQYEyPn2rEu2MoG9xLuSVAwwM5DJ+Qdd9wEXsk3ewp5JH4Pz4vP+Dgq7 jkSOS+DFTC4MrkUv6dMsE1+2rqdDpf1R+XzGFOHnAZ3ZXcXs84LHZ2asr6e8q6GMkHu9 BxSf7YzQMY8p9duZqoIi816R7HCkYCBVWKA+Y4yJjvp97cg3Ih+nJPTg2ng+NPBjm3PB BJ++XP79cnbkEf1Fiz/xkIinzbwWGorCAcxtDdDEBalh+sAyQ281PFOkBIbh0eQyPZW+ MpNRPU/5z8WhWle5NFcMGiMnvNFEngG9vD7iC+rBG935J/szP3zM8FD0EBm7VMM9GXl/ GzgQ== X-Gm-Message-State: AOAM531rGPaLb6RJkNzN/IqQJxwUdr1zY3byqBaR5V/RxSrftl6pHlJl unBCi2pCu7vmMx6SzN82Fvd/k6i/uVt0ANrNKh1pL4Cs X-Google-Smtp-Source: ABdhPJwcgMLLureS1Ih7MHXbrzKKE0vfRtFal1hKsFZlLuZR2sJy9Uu9C77sWbgHZQPqCY9z+l9uRrBC0VmcCMCfL+8= X-Received: by 2002:a05:6512:1087:: with SMTP id j7mr16912244lfg.638.1630327058174; Mon, 30 Aug 2021 05:37:38 -0700 (PDT) MIME-Version: 1.0 References: <20210830141342.2077bcfb@mcmic-probook.opensides.be> In-Reply-To: <20210830141342.2077bcfb@mcmic-probook.opensides.be> Date: Mon, 30 Aug 2021 14:37:21 +0200 Message-ID: To: =?UTF-8?Q?C=C3=B4me_Chilliet?= Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000002b989b05cac619c1" Subject: Re: [PHP-DEV] [RFC] Deprecate dynamic properties From: nikita.ppv@gmail.com (Nikita Popov) --0000000000002b989b05cac619c1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Aug 30, 2021 at 2:14 PM C=C3=B4me Chilliet < come.chilliet@fusiondirectory.org> wrote: > Le Wed, 25 Aug 2021 12:02:49 +0200, > Nikita Popov a =C3=A9crit : > > Hi internals, > > > > I'd like to propose the deprecation of "dynamic properties", that is > > properties that have not been declared in the class (stdClass and > > __get/__set excluded, of course): > > > > https://wiki.php.net/rfc/deprecate_dynamic_properties > > If I understand correctly the RFC, in these two classes: > > class A { > public $prop; > > public function __construct() { > unset($this->prop); > } > } > > class B { > public $prop; > } > > The property $prop is not in the same state in the end? What is the > difference? > isset returns FALSE for both, no? And property_exists? > In the latter case, the property has value null. In the former case, it is unset. In both cases, it is declared. Accessing an unset property will trigger __get/__set. Accessing a null property will not (assuming it is visible). Is it something that was the same before the RFC and would be different > after, > or is it already two different cases and how? This RFC does not have any impact on this behavior. This is a "standard" pattern used for lazy initialization. Regards, Nikita --0000000000002b989b05cac619c1--