Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119929 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 2062 invoked from network); 11 Apr 2023 14:41:02 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Apr 2023 14:41:02 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1A26718056C for ; Tue, 11 Apr 2023 07:41:02 -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.3 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE 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-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 11 Apr 2023 07:41:01 -0700 (PDT) Received: by mail-qk1-f179.google.com with SMTP id p23so3107536qki.4 for ; Tue, 11 Apr 2023 07:41:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681224061; x=1683816061; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4V7kpq4GkZuaFh0PSg+3mPgAUlA61GmKI8UGEvqdV5g=; b=Q8nR/CO2PnxJ33qmxtVdH8uh711WW4mcDlbYnvNbE3QqWzdTgm08fGqE++2RPwuCT7 gZru0RrnOi3cIxNLZVmvfGkYBMdLdEz73Bjhfe6JKQ6QtaZ0+o22QUknWwMYjnEINmk9 aWrsmYH+1oft5aZys2z0q4PR9+GzyyVQ2KrOktYYs+hzf/hx4hF+I2fnoDdChukhrpFb BPALrApLKLkF8SRGxhzW7KKuB+ycYD2mn1BuxJ4elY1ROe1MwQ5ZqEETJ7ND5ZeYLe6O ikkFPGM9RpyNck+eOaG1Whz/2RdRqiSrS6ZPL2Ny5WNBr/Ek8BLzYO5ndYeuYPb9n8yT zY/Q== X-Gm-Message-State: AAQBX9cEJhnhGWPTG+5Z8+flVzdFopCGC294z3x9GXwKDuZonqIHhmk/ Z4Z+CO88B0Mc9ce4XBfdKtayChvG/hLpxmlN5FWURA== X-Google-Smtp-Source: AKy350a9Xw1bnO0O/TRJeotwXIwm/yr7Zb35DzAArC4hJ/rvtDM/VXiBlQmsaEszhBpbPCO/8HwWpzNkS1huaR+AKUo= X-Received: by 2002:a05:620a:2546:b0:748:5b93:ec65 with SMTP id s6-20020a05620a254600b007485b93ec65mr4633738qko.13.1681224060943; Tue, 11 Apr 2023 07:41:00 -0700 (PDT) MIME-Version: 1.0 References: <8abbed60-5569-4eca-ad12-957877feed9b@app.fastmail.com> In-Reply-To: Date: Tue, 11 Apr 2023 09:40:49 -0500 Message-ID: To: Robert Landers Cc: Lynn , Jeffrey Dafoe , php internals Content-Type: multipart/alternative; boundary="000000000000f0d8c205f9107a0c" Subject: Re: [PHP-DEV] Future stability of PHP? From: pollita@php.net (Sara Golemon) --000000000000f0d8c205f9107a0c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Apr 11, 2023 at 9:18=E2=80=AFAM Robert Landers wrote: > > You can add `#[AllowDynamicProperties]` to classes where you want to > allow > > dynamic properties. > > I don't think that will work in PHP 9? > > In Niki's earliest draft, he wanted to completely remove dynamic properties from *default* class handlers in 9.0, as this would simplify the most common use-case for classes and objects and improve their runtime efficiency. Even in this case, however, the stdClass specialization would have dynamic properties implemented in a way which would allow an escape hatch for user classes via extending stdClass. We wound up with the attribute approach instead, which means that the logic for dynamic properties, as well as the allocation overhead, still has to exist in all userland classes. All approaches however, came with stdClass working as expected out of the box, and a low-effort, forward-compatible escape hatch for those rare cases where dynamic properties are needed on custom classes. This is because PHP's dedication to stability IS, AND REMAINS, steadfast and fanatical. -Sara --000000000000f0d8c205f9107a0c--