Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108692 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 83244 invoked from network); 20 Feb 2020 02:10:38 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Feb 2020 02:10:38 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4049A18053B for ; Wed, 19 Feb 2020 16:26:38 -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_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-yw1-f54.google.com (mail-yw1-f54.google.com [209.85.161.54]) (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, 19 Feb 2020 16:26:37 -0800 (PST) Received: by mail-yw1-f54.google.com with SMTP id a125so1054947ywe.12 for ; Wed, 19 Feb 2020 16:26:37 -0800 (PST) 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=V37zAlQmpx4sO44L22FPPB1qtqjboAGt9TEJtEYagPo=; b=b/oJFddT2HqsnlfWm02WjPJwmBMsdComO529H86gJ1lFS4sirGc0g4DOYwDBkjXvIo TWLHwrkzJOlOCTxQ2oTOqofUvB0Yisafyb6rjMtjUu565i1ixdbETZ1LECKDUmDCEuHD DWDZCBZu0k8GN/NYi1rQuMs9ik7R5ecwnK6Mpqo0bnhERZh1z8b0uSd4dwX9KhZZiM9w 1gXJTfK0Xg4TR8P4aE+YfBt1j7xhZIY8XFcm92WgtR4wzVG5ZTgD3B+6G+0+B+zbK3Or smx400d1nPtlcl/XoHSuSgmlcfj6tYTvfCvoZI+vLBkLVqc47n93BPyFZ+jC5Gu9UVQ+ 8CJg== 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=V37zAlQmpx4sO44L22FPPB1qtqjboAGt9TEJtEYagPo=; b=S8j4r06i+eX60tSlos7uW/BCgxeq4b4xw9a8Kpaxtc8HAjS+JVj5Bjff8byQzU12n9 MsWPiLGNx5BTQysxrBEAN2/IZZ6n7vzNTfONGWAt0arz7kcOk2i5cArUOWSE6P9SL/jO RanloF0tsrRF3YhQl9wf+Xde1Urc21yYAURABtd4GCB2nbRxXBQ0hLFL3pC4ye4X+ZSt Abv2wrxrJnpmy2DU0pU65KJub6e5LLom7Ie7BVH6vFEw8YAMSHaH9MBmfbEjxajujm0B je4EU/EhM7L3KRTYBQEpsZxwfpcJlFGkfrRQLbAuW/+zt8QO0QcmmHPTVJ4J9jVw1R3f CXVg== X-Gm-Message-State: APjAAAUUJjSAQ7VpwEKbM2WAjVO+3aRr3UHS7osbvxi9GQ4OSMWWS1Fa xoeU7fGLoIsk4nfghHx/oeMrjIux4UzXTPJnTaw= X-Google-Smtp-Source: APXvYqyAqNxLiItY5HlPL8s1/l8perX9FGUU4mT/nNQ3zzWDoy3ShRiSrB16WLeifnXar6VegxqAbLI7LDqUrhQxPds= X-Received: by 2002:a81:b82:: with SMTP id 124mr21992811ywl.272.1582158396942; Wed, 19 Feb 2020 16:26:36 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 19 Feb 2020 19:26:25 -0500 Message-ID: To: =?UTF-8?B?TcOhdMOpIEtvY3Npcw==?= Cc: PHP Internals List Content-Type: multipart/alternative; boundary="0000000000003a6ec8059ef6f571" Subject: Re: [PHP-DEV] [RFC] [DISCUSSION] Immutable/final/readonly properties From: matthewmatthew@gmail.com (Matthew Brown) --0000000000003a6ec8059ef6f571 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Someone recently requested something similar for a PHP static analysis tool I wrote (https://psalm.dev/r/f75997a263), though that version only allows lazy initialisation inside the class in which a given property is declared. Personally I don't like either approach =E2=80=93 I think per-property gett= ers and setters would be a more appropriate venue for this functionality, something like: property int $s { public get; private set; } This pattern could also be extended to support per-property getter and setter methods. On Wed, 19 Feb 2020 at 12:06, M=C3=A1t=C3=A9 Kocsis wrote: > Hi Internals, > > I'd like to move my RFC forward to the discussion phase: > https://wiki.php.net/rfc/write_once_properties > > In short, I propose to add support for a new property modifier that would > allow properties to be initialized, but not modified afterwards. > > Cheers, > M=C3=A1t=C3=A9 Kocsis > --0000000000003a6ec8059ef6f571--