Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114276 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 14541 invoked from network); 4 May 2021 20:26:49 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 May 2021 20:26:49 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5AFE41804CC for ; Tue, 4 May 2021 13:32:55 -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,NICE_REPLY_A, 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-Virus: No X-Envelope-From: Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (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 13:32:54 -0700 (PDT) Received: by mail-ej1-f42.google.com with SMTP id u3so15162277eja.12 for ; Tue, 04 May 2021 13:32:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=eVBzNbPt8iOTct2CmkP3euKE2wFUp0427cCAhXbZyfk=; b=XxbiMLChJmHwn0bucoySdsfL4Y99FruoWHoKIHfedofTmzF6jTT/O4KiGOpxZFrZI5 nyZMIqEolj1yYuYJzRw/i+HwvKn+B48+2tjuSb5Jq+sSbf5S0zBHk3VHphDt5eBdaBXb iiwPwXRokJcHXR7HwqceApikga9JyzcKCthI5xKR0koWb7g/9el09mCRS2eX+zsYhfSg IKZ0ntG1gNEqWxaQG6OVg8s1RStaxhn0KUlx+6Yp+p5RPuP0aXKlyZCD1qXO3if/E+4A E+FT1VQkdwa7CPsNlIqYTWo+ukwj2wUA6wGifwLqT+h6TZ9SYHZMeJaTwP7LaeqiSKT4 id4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=eVBzNbPt8iOTct2CmkP3euKE2wFUp0427cCAhXbZyfk=; b=NLAb7F2ufs03xXLUZY3HKOr7DzN4nMeogm1YlFWxWMYUCKtfHEnh6BEjMKqTh/3+8e 2tV3fc918ysMXJVy0gx7quHHLVFXTaUQt7Nf56WeKfXk9fAR44MADd6UMZT5XD8MeNoq nJDDYIiXdvxsTBZfzSNWlthikMzGb0UlQNOn4GkSEaKIzoghVV9DSHc83++8m0xlRI+r JcmkVHONEfWGRohtwqX6eJuwfk1sqrm8lC4jZSRAnC8/hJa1PMiEL4uBxrZq71/rXNZY JPpyO5uF9XtZ3vcKUqa2iq8WPvhsOy/wgDaUHNj/GlvJ3n5uigrwBUoN5Kc3eCF+RBJE cvpQ== X-Gm-Message-State: AOAM533QGEDpi7bUROWYz6pWAmoX0YYxBoONydKXIApjNAm8KKvBiB1l uQI8JHUD25VuvsfQkNtd7FcD8S61/vM= X-Google-Smtp-Source: ABdhPJwailVpFtpzB9QgTZpSMC1ZxrPzvhHV52ZgjyyDhjBVwaXB/Pd5d++rX3DfDc/KGwfKPIOD4w== X-Received: by 2002:a17:907:948d:: with SMTP id dm13mr23270628ejc.180.1620160373642; Tue, 04 May 2021 13:32:53 -0700 (PDT) Received: from ?IPv6:2001:983:6fc5:1:34fe:abaa:a0b1:6b44? ([2001:983:6fc5:1:34fe:abaa:a0b1:6b44]) by smtp.gmail.com with ESMTPSA id w14sm15605725edj.6.2021.05.04.13.32.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 May 2021 13:32:53 -0700 (PDT) To: internals@lists.php.net References: Message-ID: Date: Tue, 4 May 2021 22:32:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Property accessors From: dik.takken@gmail.com (Dik Takken) On 04-05-2021 12:33, Nikita Popov wrote: > Hi internals, > > I'd like to present an RFC for property accessors: > https://wiki.php.net/rfc/property_accessors Wow. Thanks for all the effort you put into this! > 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. I think property accessors could be a huge enhancement to the language and may significantly change the look of PHP code in the long run. To fully appreciate what property accessors could do to PHP it may be useful to compare PHP to other languages that already have property accessors. In my case, I use both PHP and Python. By comparing how I use these two languages I can attempt to project how property accessors may change the way I use PHP. When I compare how I design APIs in PHP and Python, I expect to be exposing more public properties and fewer class methods. That will result in less library code. When I compare how I use APIs in PHP versus Python, I expect to be doing more direct property accessing and less method calling. That will make code look less cluttered in general. The complexity may very well be worth it when fully considering the impact it could have on how the language is used. Regards, Dik Takken