Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116436 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 88940 invoked from network); 17 Nov 2021 08:09:43 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Nov 2021 08:09:43 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3A8731804C6 for ; Wed, 17 Nov 2021 01:04:53 -0800 (PST) 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-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (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, 17 Nov 2021 01:04:52 -0800 (PST) Received: by mail-ed1-f41.google.com with SMTP id w1so7813495edc.6 for ; Wed, 17 Nov 2021 01:04:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YVk0N7x3oYI/hqVRwlioI0CsQRSYSagflHewHOBIbAM=; b=O7nArnmqkca4KhLRotA2ixUVcVwj0QL5SIxbWiXu7Gri9JFnmHmGsSx+S8v4+XDHkk mOYFNO2Ru8S4uA75HnE/vpf0Qvx4d+jv56mfLzxzUUovNmfE7DlsBQ3Ssdz0QZIYzdhv HTGOEoPl96RncHGs3w/W6B8jOdtdlLrkynyTp8vGinUi1PJpn+mEXEOB6TKkmu7Zv9h+ 9O/9YoIhSUSzO5RVCyzP4zMV0wW1ku0CIjb83XyL5RQECUz3pjU6tg0/8dwd5Brcw0TP Gpg6a3FvUC6y9+ZEtFFRSDeMyCf2nxqVxcUcCsaLuURC6Pb96fHykqqCWOyNIlMtFoIG /+cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YVk0N7x3oYI/hqVRwlioI0CsQRSYSagflHewHOBIbAM=; b=06iJ+irMyjJDfE8pUUqimUfW6iVd/ziFL823PaIjATMggyzvM1ZZh0uAd3pXqW1qyl XVom2P+l/OLy7cSiB3wwtx8bOpxxV50+7cydkHG4dh2755G8ICRISkZQ7SnYdnhzwJEi AqBpM0Q31jlD5Vd5bsLnYzmyqlvbPDpf/lK+cy6r8Eu9infCo+N+tNLDSAy6/M6POUx9 DSwYmeItlTPkv7szN2V83xgcnF7SFkynrbSlp1Fw/IKTlQ9XYarm6pcdAS0oOVBl1k3m 6aM1jFPvMQGnU+JlyoXHnHD22qLROG5LYHAijpOOBlbzWgBEeN5HEZfxqTuNuTJbXkJf Xeuw== X-Gm-Message-State: AOAM530FQKUVszvylp6aKG+SmTwa+QAcGhA39/wBmnYQu6OGCkVPQfpG JeWVmN4nZTF0dgocnF4EsmjWeLYXNOSPynWZ7lHhJoMs X-Google-Smtp-Source: ABdhPJzcx9BgXBxr5sDuVp/91IbgHxNZJW30Q6zjUk3/0AiDu3uGMGwX0ROp9QwvIPBVzybTDEfqo+EvVYVdKTeCiZ0= X-Received: by 2002:a05:6402:270d:: with SMTP id y13mr20018730edd.362.1637139891249; Wed, 17 Nov 2021 01:04:51 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 17 Nov 2021 10:04:34 +0100 Message-ID: To: Paul Crovella Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000aa63c805d0f855e9" Subject: Re: [PHP-DEV] [VOTE] Deprecate dynamic properties From: nikita.ppv@gmail.com (Nikita Popov) --000000000000aa63c805d0f855e9 Content-Type: text/plain; charset="UTF-8" On Wed, Nov 17, 2021 at 5:35 AM Paul Crovella wrote: > On Fri, Nov 12, 2021 at 5:08 AM Nikita Popov wrote: > > > > Hi internals, > > > > I've opened the vote on > > https://wiki.php.net/rfc/deprecate_dynamic_properties. Voting will close > > 2021-11-26. > > > > Regards, > > Nikita > > In the Motivation section when talking about static analysis the RFC > makes the claim: > > > The #[AllowDynamicProperties] attribute proposed in this RFC makes the > cases where dynamic properties are used intentionally explicit. > > however this really isn't true as the attribute is on the class rather > than the use. Static analysis will still have no idea whether any > dynamic property assignment is indeed a bug or intentional. The > information added is only whether the author of the class has deemed > it okay for dynamic properties to be used on it, not by it. The class > author and the dynamic property user might not be the same person or > have any relation. The class being intentionally used with dynamic > properties is not necessarily in the user's control. Similarly the > class being unintentionally used with dynamic properties may not be > either. > There is an assumption in the design, that certain classes are designed to be used with dynamic properties, and all dynamic properties are acceptable in that case. This is basically classes that could be using __get/__set, but instead use dynamic properties for reasons of simplicity, performance or migration ease. If the class only works with a fixed set of properties then those should be declared instead, and if it has more complex constraints, then __get/__set can be used to implement arbitrary rules. (Setting dynamic properties on classes you do not own and that do not opt-in is explicitly unsupported under this model, with the recommendation to use WeakMaps for non-intrusive value association instead.) Regards, Nikita --000000000000aa63c805d0f855e9--