Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89271 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36614 invoked from network); 17 Nov 2015 20:38:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Nov 2015 20:38:47 -0000 Authentication-Results: pb1.pair.com header.from=dev@mabe.berlin; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=dev@mabe.berlin; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mabe.berlin from 80.237.132.167 cause and error) X-PHP-List-Original-Sender: dev@mabe.berlin X-Host-Fingerprint: 80.237.132.167 wp160.webpack.hosteurope.de Received: from [80.237.132.167] ([80.237.132.167:45784] helo=wp160.webpack.hosteurope.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6B/23-30130-4509B465 for ; Tue, 17 Nov 2015 15:38:46 -0500 Received: from ec2-52-31-100-127.eu-west-1.compute.amazonaws.com ([52.31.100.127] helo=[10.8.0.6]); authenticated by wp160.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) id 1Zyn1U-0001bt-Ff; Tue, 17 Nov 2015 21:38:40 +0100 To: internals@lists.php.net References: Message-ID: <564B904F.4000401@mabe.berlin> Date: Tue, 17 Nov 2015 21:38:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-bounce-key: webpack.hosteurope.de;dev@mabe.berlin;1447792726;2460fec3; Subject: Re: [PHP-DEV] Immutable modifier From: dev@mabe.berlin (Marc Bennewitz) FYI there was a very small discussion about it ~ 1 year ago https://www.mail-archive.com/internals@lists.php.net/msg71521.html On 11/16/2015 10:15 AM, Chris Riley wrote: > Hi, > > There has been a lot of interest recently (eg psr-7) in immutable data. I'm > considering putting an RFC together to add language support for immutables: > > immutable class Foo { > public $bar; > public function __construct($bar) { > $this->bar = $bar; > } > } > > Immutable on a class declaration makes all (maybe only public?) properties > of the class immutable after construct; assigning to a property would > result in a Fatal error. > > class Foo { > public $bar; > immutable public $baz; > } > > Immutable on a property makes the property immutable once it takes on a > none null value. Attempts to modify the property after this results in a > fatal error. > > Any thoughts? > ~C >