Re: Immutable modifier
| From: | Andrea Faulds | Date: | Tue, 17 Nov 2015 01:47:06 +0000 |
| Subject: | Re: Immutable modifier | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-89253@lists.php.net to get a copy of this message | ||
Hi Larry,
Larry Garfield wrote:
The "everything in the constructor" is the problem. That results in, essentially, an obscenely long function call that just happens to be named __construct(). If I wanted something that obscure and hard to work with I'd just use anonymous arrays. :-)Huh? "with" methods and __construct are not exclusive. In fact, you could have a private constructor and only have "with" methods. Only allowing assignment to properties in the constructor doesn't prevent having a nice API: have your methods call the constructor. I don't see what you're getting at here. -- Andrea Faulds http://ajf.me/