Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114272 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 86458 invoked from network); 4 May 2021 15:16:08 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 May 2021 15:16:08 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3B8E1180501 for ; Tue, 4 May 2021 08:22:11 -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, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (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, 4 May 2021 08:22:10 -0700 (PDT) Received: by mail-lj1-f174.google.com with SMTP id v6so11646326ljj.5 for ; Tue, 04 May 2021 08:22:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=41CQpoYLnAaO7dXs7VFQTSWBuzzw+3FeQKYLiDmBQC8=; b=m11MftahGxOv6pwKIIw4vHIRU/jI1riUS3Gd/KPeBxmsgYzCVSll8MGrWvrWhccaRv 5Izb9Nr8hFh5qEe04HzPvOqPVl1SOIYZW8yEiaQXkitZDnmKSWV8RTTLMZ2Oe2VeGwdQ saCWCZq2JwrylDEtMR4yagISf/6o3O/DFKvCjOEQVzl6DWv698UoUw8meydKM811uDKK 0g3Imzv7kBkG4eilp1jgfd+1ZMvI7GhBCw/eKWwUQn4wNHInQQBX+H2Ai15X/B6O2FN9 3PwLiYyAGOgtKBgNgpl4dG0rT9Ltiz4TK+jr5bLA2ATRc38hSO5+HQK0dGPE8aC91gt+ dDbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=41CQpoYLnAaO7dXs7VFQTSWBuzzw+3FeQKYLiDmBQC8=; b=c81USZLHoBxAHUJhXxGUe7ge3/2k+i6NazvKYgCnJh+Wbs7yHZRS/yjCNbeiLk25NU ksRpQb5ARukzXGYjvPXp1gY3U0Q6174LXV60EfMvMILuLi+bXitKqkjxM9nydqeSP6BO Fjy3bMHn4Qg6qRNy5ZdHIgF4zfnp41JfrsMWsV7NWMYsIwulbBkWymBglbvvT8NHxaWV 9P4oyWooqH40mciHlWWyL8No8Z7q9d68uRGg1TtXVeuEBqLCq8N1O6pHG+jR+fHTkx9T UsTMM0jpExL+kZcqCC+wvApU6XiOwmwnLX3ODm5tVMBvzmzO9g78IofzE5eaV+xpYP2o 1ChA== X-Gm-Message-State: AOAM531xnqlnIGKDrHtYptbkgcwjyJsulaXRoaIHMNfwNPmJr9AbMCKj LdWmcVQCDCeHCJmDCGfp8F1EjUfmOp0LNMAjtEE= X-Google-Smtp-Source: ABdhPJxT6hRV4o8PmriqIqKFlS8C9yWBAzq26Jn5elhxF8pKKP94n7FOFb/1LzyoTiuacjtMy89DbW111xYM8cdakbs= X-Received: by 2002:a2e:93c4:: with SMTP id p4mr17334207ljh.367.1620141726770; Tue, 04 May 2021 08:22:06 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab3:1102:0:0:0:0:0 with HTTP; Tue, 4 May 2021 08:22:06 -0700 (PDT) In-Reply-To: References: Date: Tue, 4 May 2021 17:22:06 +0200 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] Property accessors From: olleharstedt@gmail.com (=?UTF-8?Q?Olle_H=C3=A4rstedt?=) 2021-05-04 12:33 GMT+02:00, Nikita Popov : > Hi internals, > > I'd like to present an RFC for property accessors: > https://wiki.php.net/rfc/property_accessors > > Property accessors are like __get() and __set(), but for a single property. > They also support read-only properties and properties with asymmetric > visibility (public read, private write) as a side-effect. > > The proposal is modeled after C#-style accessors (also used by Swift), and > syntactically similar to the previous > https://wiki.php.net/rfc/propertygetsetsyntax-v1.2 proposal. > > While I put a lot of effort into both the proposal and the implementation, > I've grown increasingly uncertain that this is the right direction for us > to take. The proposal turned out to be significantly more complex than I > originally anticipated (despite reducing the scope to only "get" and "set" > accessors), and I'm sure there are some interactions I still haven't > accounted for. I'm not convinced the value justifies the complexity. > > So, while I'm putting this up for discussion, it may be that I will not > pursue landing it. I think a lot of the practical value of this accessors > proposal would be captured by support for read-only (and/or private-write) > properties. This has been discussed (and declined) in the past, but > probably should be revisited. > > Regards, > Nikita > Is this a typo? get() {} // Must not have parameter list But there are no parameters...? Olle