Re: [RFC] Immutable variables and objects
| From: | Lester Caine | Date: | Mon, 02 Feb 2015 09:19:34 +0000 |
| Subject: | Re: [RFC] Immutable variables and objects | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-81574@lists.php.net to get a copy of this message | ||
On 02/02/15 07:31, Alexander Lisachenko wrote:
> Agree in that point with you, this can be a good instrument if implemented
> in PHP. I see a good point in it by using this with interfaces and "const"
> modifier for parameters:
>
> class Foo {
> public function bar(const Baz $object); // Require an instance to be
> passed as copy
> }
OK as usual I am missing something again ...
This is probably because I still don't understand objects, as I still
just consider them as arrays with a few more complex elements. I STILL
work on the basis that is I pass by reference, I can make modifications
to the data while if I don't I get a copy and have to pass the copy back
if I need the original changed. This used to be all very simple, so when
did it stop working? This may explain why I get into trouble with stuff
that has been working for years but after 'modernising' starts throwing
problems :(
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk