Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89223 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43292 invoked from network); 16 Nov 2015 09:15:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Nov 2015 09:15:44 -0000 Authentication-Results: pb1.pair.com header.from=t.carnage@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=t.carnage@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.52 as permitted sender) X-PHP-List-Original-Sender: t.carnage@gmail.com X-Host-Fingerprint: 74.125.82.52 mail-wm0-f52.google.com Received: from [74.125.82.52] ([74.125.82.52:34025] helo=mail-wm0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3A/82-14654-FBE99465 for ; Mon, 16 Nov 2015 04:15:44 -0500 Received: by wmvv187 with SMTP id v187so165498540wmv.1 for ; Mon, 16 Nov 2015 01:15:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=LqwxUD+TiRJ/V3rSBmCKrYQGGe3/oSPAHm6q3Xz82Fk=; b=FRBgN/5hSqLrdsH5qIs7XL/T5MP1BJ3ivkk2qSrb7foj4RluCPihC/knfza8Y/rQmy HR10RIN/M1z6ivDdWlbQEfL6aFfQQ8lO/ZxEdp4hRLx+s9xU4F2KsPWARQhBlt6nUPsZ qsmHZ1dMz49h22R10xba58fnLagXFHGtLjZQI77gvfOi5KwbdqoLimcVfUIzNegbuMl2 kZYsoCZ/SB3yxFKftVUodLpfHdNLQQTH7vR4EAiWx6oB20OpNzaw4tokY0JxGXTDDznT avIQva/Vus2FAXuVwlZuI8k318e9p+ortZnN4bkQkKIggtbOfhjt7Zy5w86Kl2gaOrKg iX+w== MIME-Version: 1.0 X-Received: by 10.28.136.15 with SMTP id k15mr16774200wmd.51.1447665341205; Mon, 16 Nov 2015 01:15:41 -0800 (PST) Received: by 10.27.130.149 with HTTP; Mon, 16 Nov 2015 01:15:41 -0800 (PST) Date: Mon, 16 Nov 2015 09:15:41 +0000 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary=001a1144242a6a94270524a4dae1 Subject: [PHP-DEV] Immutable modifier From: t.carnage@gmail.com (Chris Riley) --001a1144242a6a94270524a4dae1 Content-Type: text/plain; charset=UTF-8 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 --001a1144242a6a94270524a4dae1--