Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110794 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 8551 invoked from network); 30 Jun 2020 13:58:03 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Jun 2020 13:58:03 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BE9AB1804CB for ; Tue, 30 Jun 2020 05:46:59 -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-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (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 ; Tue, 30 Jun 2020 05:46:59 -0700 (PDT) Received: by mail-lj1-f178.google.com with SMTP id e4so22311634ljn.4 for ; Tue, 30 Jun 2020 05:46:59 -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=EnFWjCrMmP4PkfG5L6v61dc2A59Mb8hxpV3Vsap69QM=; b=JqUuDUtLlPWs4KcOzjft85eZq4bmuB4PVLsEKyWSkzJgVP4PPUa4fLbiqzuyszkig3 kFTPfugdQbFEF8vfVOLuw0JunMHxMT/Z49mQxnxGxLPibWgtoJNy7Re6PJdCbn2nv2TZ HswRH2/NvookQ/BsdLw+8BJQsamTdV72dHZVx7MYgR/w4O7A+XXjQb3bYsQI2wtIXwNZ qEQgg4tp/NcMSfRiD7viiojJiukOm5OBAn4JgVCvFB58a9F1bPOPlj/1eCbk8B75fUwB 0MnGzBanfKjPWEfGItpJr14F2ofVlZ1U5OVwpgBv5tPIGUKhL8z1EeOTpM5BzP7prTN6 OIgw== 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=EnFWjCrMmP4PkfG5L6v61dc2A59Mb8hxpV3Vsap69QM=; b=tHEKGoGvQzsFvSwVakSYXyq36cXTu9iCaJBlw3DjjxxQ0JmjYIIqrokxAf1eh2tgRf a5tvQOizEzEp9N+7e0sqINJxfx5eN0OMiIP3ONVbcAwAUmANwA5V89ZHMQvze2p7WFry Fo0IgiHFn/RSZQc0EkHaNDJYqEHP5XJ2tqQs08+RHDrVxHp2VmPk+dZK8/AYbuS3J6BQ BVEF3a0dohYY2/RramJPwCZ5KTxdxzn+Z3sRNrqu0mYDW4Y9VTx11BkQ5jWwb1WQZj+f x/6N0RL5kuWEOJXxGWZcSDjb5FelcFNgKTDeflDWi0WtA4PC0gxCzgL9QVR/GuKgtNxA BuyA== X-Gm-Message-State: AOAM530QSo1ixT+RJCy4xvXEGP3nBaWSh8LM6hVoTPf2pqyxP8saLc/h 1SPienQUew0GPLlGmskvCfqEgLk1LxQo7KHlVyU= X-Google-Smtp-Source: ABdhPJwo4c8MqeSqsErIQmy55rkTzFisBXwtW8TsLd/CE7kkojTJyWA6rUYTpiZ6tg1BKR65i4plQpOcMUzY2oYHhY0= X-Received: by 2002:a2e:b892:: with SMTP id r18mr11110084ljp.319.1593521214047; Tue, 30 Jun 2020 05:46:54 -0700 (PDT) MIME-Version: 1.0 References: <49219ad7-124f-6b95-b691-984c69f8a1d8@freedom.nl> In-Reply-To: <49219ad7-124f-6b95-b691-984c69f8a1d8@freedom.nl> Date: Tue, 30 Jun 2020 14:46:43 +0200 Message-ID: To: Dik Takken Cc: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000e7c8e405a94c9130" Subject: Re: [PHP-DEV] [RFC] Property write visibility From: andre.romcke@gmail.com (=?UTF-8?B?QW5kcsOpIFLDuG1ja2U=?=) --000000000000e7c8e405a94c9130 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > Perhaps another option could be to use attributes: > > <> > public int $id; I=E2=80=99d actually also like a syntax like that as well for ReadOnly and Immutable in the end. It's more readable and it would be possible to annotate on the class level as well (to affect all properties). So I initially explored* in this direction, however if we go that way first we'll likely end up with any reflection code having to deal with attributes and understand their underlying visibility semantics. If we rather go this route of first introducing the concept of disconnected visibility. The reflection API is far clearer / understandable, more future proof, and adding the attributes as immediate syntax sugar followup is far more straightforward. * initial explorative draft rfc: https://wiki.php.net/rfc/readonly_and_immutable_properties --000000000000e7c8e405a94c9130--