Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115805 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 63600 invoked from network); 25 Aug 2021 10:21:41 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Aug 2021 10:21:41 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 319A21804CF for ; Wed, 25 Aug 2021 03:55:54 -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-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-oo1-f47.google.com (mail-oo1-f47.google.com [209.85.161.47]) (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, 25 Aug 2021 03:55:53 -0700 (PDT) Received: by mail-oo1-f47.google.com with SMTP id s21-20020a4ae495000000b0028e499b5921so4725179oov.12 for ; Wed, 25 Aug 2021 03:55:53 -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=nTW/ePIR02Hq27YSnvEqIwogrHXiNuTbzaxFQfxweqM=; b=GAllSg2VoNwkKsm9tJ9F/3qjFuJrQFA/5Ws9+8nbZymYVoo95rllp6zdzkQa56urAt JxUJqhJ8XHm82l4+9of4mmyRn7ME0koaoZCB/KiZBIPkzuecDb9SRSAWbwnvuFomkhI7 wwwPG1ffxImQmSzAxnOPEH93WjzledCieQC5I+3r5M5QhwJ52jH5KrgGIYk0qmt3nZsu YaADXrEHWqZg7Wm7+I3Y2Vx5vXm5QUSPRkrOeGP2NnxCEHDb0Sf5Lb6vmdwvMm9mTvrO f3JXmfrow7DP9qbN0BMmMBevBKldGhYwpnanke1akIeyZ7qWrSvypigBEVtAVpJCV1TS WdFw== 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=nTW/ePIR02Hq27YSnvEqIwogrHXiNuTbzaxFQfxweqM=; b=PnTBTlxlEGA73x0rsLuJVizSURw/Jbzlg0BfjhXOf+Ad+P69oS81OTrQ5hZXWeG9sB EtOFvYkMXHBUAcLX0l0ukqhw4+IwV3RL3Phqg/J7ZTGwrrqVFpu8IZcHxvt1Q7638Hca GD8B5UtkUzToFOm+y04SgUET65e1kakCYtE3YUPNSkpUt7/IeJcWfTXwjYHxwT3TROi8 5X0QoINgaapjO3gO+8gEDB1rDoXLGR16lZRtiUmtlkifqO3vdjDStGRKDUgRQ7Jg27uI yqGpphskZnDUsnq7134JYVVL+Y0CzZHhvQqsmHMFqgy3tXG/V9u95icw2gWbkTeDDhzy rIqQ== X-Gm-Message-State: AOAM533CFq9s92D6EZATT8qMhdPYi9lfs35oAIJ6cPK2BQJBmb7TM8PT Zmat8AzcNruG57zuskF6vU+9xbIWMlBVwWZT3jg= X-Google-Smtp-Source: ABdhPJwxd/61uxNr4/2EvkvEuNlg3TMfheMv+Xbhd+2H45tO/Xz5OxctdlbAaQ8O3Wj+mPHzhyKZHKw+xjHRUemvZfc= X-Received: by 2002:a4a:a78a:: with SMTP id l10mr33542126oom.30.1629888952868; Wed, 25 Aug 2021 03:55:52 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 25 Aug 2021 12:55:41 +0200 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000000f253005ca6018d6" Subject: Re: [PHP-DEV] [RFC] Deprecate dynamic properties From: ocramius@gmail.com (Marco Pivetta) --0000000000000f253005ca6018d6 Content-Type: text/plain; charset="UTF-8" Hey Nikita On Wed, Aug 25, 2021 at 12:03 PM Nikita Popov wrote: > 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 > > This has been discussed in various forms in the past, e.g. in > https://wiki.php.net/rfc/locked-classes as a class modifier and > https://wiki.php.net/rfc/namespace_scoped_declares / > > https://github.com/nikic/php-rfcs/blob/language-evolution/rfcs/0000-language-evolution.md > as a declare directive. > > This RFC takes the more direct route of deprecating this functionality > entirely. I expect that this will have relatively little impact on modern > code (e.g. in Symfony I could fix the vast majority of deprecation warnings > with a three-line diff), but may have a big impact on legacy code that > doesn't declare properties at all. > I'm totally on board with this! Others in the thread have mentioned that these dynamic properties can be used for lazy-loading purposes, but I think we've demonstrated (over the years) that this can be achieved in a type-safe way anyway, and dynamic properties are not needed at all. Over the past decade, I've not seen a single valid use of dynamic properties either. If this passes, I'll also deprecate and discontinue experiments like https://github.com/Ocramius/LazyProperty Greets, Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ --0000000000000f253005ca6018d6--