Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108575 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 41078 invoked from network); 14 Feb 2020 15:28:21 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Feb 2020 15:28:21 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 27BAD1804F8 for ; Fri, 14 Feb 2020 05:43:00 -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=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, 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-ua1-f49.google.com (mail-ua1-f49.google.com [209.85.222.49]) (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 ; Fri, 14 Feb 2020 05:42:59 -0800 (PST) Received: by mail-ua1-f49.google.com with SMTP id y23so3583916ual.2 for ; Fri, 14 Feb 2020 05:42:59 -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=JxmBc3hrQgkFvRivn7n7F3ggqUzaTHMWmJxfQ6GZlLE=; b=MGTcuojB3vGzABrtni47gVvDhd9Q9r4eFvoqtXqiwYhBhdQibCAcHRFfBi93gTuGEn iYRHkL//A3cbsQFWQqEDFgcNHixHpgubNCvKxYG6CgdBvQZVElCDiWkTVmF8H+AoilKh rGr7OyYsFfHnfqDfpuKFAoJ2PJ5knfs3uQoo3PjAEyYxcq4PNAG1uPzJbL4C30PqJQ/9 O/HIIyTQQeR7y0Z5nH53HL+mpXcbLcJisv3gLrwxTVR2Rk9yDsj8utqIxWdAzrPqCR3X xKfinrz6WFbdhNlUPMO6in1rbL9i+kAQ6xYevRYz9aqzDpoMXX5Z8dPlgdnZ+ydRNn9J Hs8w== 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=JxmBc3hrQgkFvRivn7n7F3ggqUzaTHMWmJxfQ6GZlLE=; b=BS2vefb9E3ctYZXDVdMXqsiMK0TIzG2ycDn+kM4M8vwDUy72frulOFTokXktLf1cjJ JpUJQN6nmfT0J1M2UWRtdTwygLX801lusgR6GZgU+UG7n3frf2DkjOB55K8GIoM0uHnt T0vJ9m7kNlr23TnMZfOHRflEoYxif8qsISUrVrPzSSeYWNXbk/8Gzg8ju87a/LLvwWrK avpM0gwAbY5Q4MXgTSVyGFfU8v6OUQXddPKZzVMeUpbe/oaeo4tgvM149n1V7K2ZYhkR UEdomPpCYOsVdP7+XtMZWqpsFoJIR/d/fjvihWjtEz1Gze1dgB/wohDEaJm3vT6Y6pKv ZDvA== X-Gm-Message-State: APjAAAUfcaSqhj1qCy1sv3A6IdAyfVptR53AUjDeqI5D4TZ8hFB7D5Q+ fOIq3R/gWe2wgvYf7zGiywt0sysAlFNX0OmqSwE= X-Google-Smtp-Source: APXvYqxQf26xMNg09Z+gukyK2YeH0bDsMe3TuZiFFh6dk3QyDer1b2u8EIsdydy0vuCutzCcSI4mTiwTSF4QmqPkhWY= X-Received: by 2002:ab0:6017:: with SMTP id j23mr1534650ual.3.1581687775780; Fri, 14 Feb 2020 05:42:55 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 14 Feb 2020 14:42:44 +0100 Message-ID: To: Marco Pivetta Cc: PHP Internals List Content-Type: multipart/alternative; boundary="00000000000005641e059e8962b3" Subject: Re: [PHP-DEV] [RFC] [PROPOSAL] Immutable/final/readonly properties From: kocsismate90@gmail.com (=?UTF-8?B?TcOhdMOpIEtvY3Npcw==?=) --00000000000005641e059e8962b3 Content-Type: text/plain; charset="UTF-8" > > If somebody really wants a `mixed` property to be immutable, they could > write `private immutable null|bool|int|float|string|array|object > $property;`. > Yeah, one of my ideas was to first add support for mixed (for which there have been a proposal/PR since quite some time), so that all non-typed properties could be implicitly upgraded to the mixed type. But I don't think it's the way to go... Maybe only if our long-term goal would be to deprecate/remove non-typed properties and implicit initialization altogether in favour of mixed type and implicit uninitialization... > That would make implementation straightforward, since you'd expect > `immutable` to be before a type declaration (can be done in the parser, > right?). > Yeah, the implementation didn't seem very tricky yet (but people with more experience with the internals of PHP should tell). However, Nikita also warned me not to support references. So this is another question to decide... --00000000000005641e059e8962b3--