Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109053 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 20995 invoked from network); 16 Mar 2020 13:19:14 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Mar 2020 13:19:14 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 07C79180088 for ; Mon, 16 Mar 2020 04:41:39 -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.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, 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-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.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 ; Mon, 16 Mar 2020 04:41:38 -0700 (PDT) Received: by mail-lf1-f42.google.com with SMTP id t21so13712845lfe.9 for ; Mon, 16 Mar 2020 04:41:38 -0700 (PDT) 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=BfT0sOya4CHoY61pGxMnDsMsjnCfR/WcrtIFaCffRAY=; b=f1LJSXjsPytQ/kBh4DhFlZjyz68MTWBwpcy5O84b/969ljSCxRJ5infIRqBq14Jd0N FJUHw82XGoQEcha2fEOozd7V9pqDQJ5abJ2ud3n6+7zsWs3EXajU9yp8gPu6+swGzLug 2GeRbLMtKTenxvXYH1YawP2LPejQPlrzJEcqjdpv1gmQIW4JyOwxcSlmcjbk2PRMFzy8 Ordf6wGX+48AD7alsdHtskGHAGqAU5CHvUhBULacFZM8hf3wUdThUvSLbuxdzhLKy7kV 7HJOcUfsrnHOG8LgR4y+xxwOkS+4NCtUSAfUjEIKkQkdGwqCRBIQBHcSt2cHewGPYRlk 67dA== X-Gm-Message-State: ANhLgQ3Osw9F3VSILrDS8yvcLWiW1zOve/n5DvO6nr9Kll+cVUDPoCp3 xMebibr7VZXd96AUvWA0N4L6a1XgkQFJQysQK3E= X-Google-Smtp-Source: ADFU+vtingvYiJSzeY49Ufom2K3haxaaSsvTqwkzPqaoL+ydgGsY4fBHXt3bMBhHqcHK7Abq2XZ0u2q3GF85Mnr07lE= X-Received: by 2002:ac2:5594:: with SMTP id v20mr16523079lfg.2.1584358895438; Mon, 16 Mar 2020 04:41:35 -0700 (PDT) MIME-Version: 1.0 References: <8545d15e-ddd5-42be-8405-09697a077234@www.fastmail.com> <4d9688fe-cc57-44af-903e-05f4cbb1bbcc@www.fastmail.com> <6bcbf0a5-92d8-4cfa-a00f-e0e967fc037e@www.fastmail.com> <700327df-45d5-47ca-8828-d7ad9c9bee2e@www.fastmail.com> In-Reply-To: Date: Mon, 16 Mar 2020 06:41:22 -0500 Message-ID: To: Rowan Tommins Cc: php internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] [DISCUSSION] Immutable/final/readonly properties From: jakob@givoni.dk (Jakob Givoni) On Mon, Mar 16, 2020 at 4:47 AM Rowan Tommins wrote: > I'm sure different people will react differently, but my intuition is quite > the opposite: I would probably call the inline assignment to the property > an "initial value", not a "default value", and I would intuitively compare > it to assigning it in the constructor. I would also understand the intent > of "write once" to be "once initialized, can't be overwritten", so would > personally have no expectation that I could initialize a variable in both > the property definition and the constructor. Interesting, so if I understand you correctly, you think of a property with an initial/default value to be *initialized* before the constructor, but a property without it is *initialized* in the constructor or later (at first assignment of value)? Is this concept of initialized/non-initialized properties something that is more or less well-described in the language? If so, I'd like to read it. Seems like a fuzzy concept to me so far, unfortunately...