Re: [PHP-DEV] Idea: immutable class / object

2014-11-27 Thread Stanislav Malyshev
Hi! > Because of for immutable objects it's not allowed to set an mutable > object as property > you can be sure the object's state will be consistent. That's the main It may be harder to achieve than you think. How exactly do you ensure they property values do not end up containing mutable value

Re: [PHP-DEV] Idea: immutable class / object

2014-11-27 Thread Marc Bennewitz
Am 27.11.2014 um 20:47 schrieb Levi Morrison: Am 25.11.2014 um 22:26 schrieb Marc Bennewitz: Hi internals, In OOP it's a sometimes a common issue to know the state of an object and to know if it was changed respectively it it can change state. We already have such objects like DateTImeImmuta

Re: [PHP-DEV] Idea: immutable class / object

2014-11-27 Thread Levi Morrison
> Am 25.11.2014 um 22:26 schrieb Marc Bennewitz: > >> Hi internals, >> >> In OOP it's a sometimes a common issue to know the state of an object and >> to know if it was changed respectively it it can change state. >> >> We already have such objects like DateTImeImmutable and new proposed >> objects

Re: [PHP-DEV] Idea: immutable class / object

2014-11-27 Thread Marc Bennewitz
Thoughts ? Am 25.11.2014 um 22:26 schrieb Marc Bennewitz: Hi internals, In OOP it's a sometimes a common issue to know the state of an object and to know if it was changed respectively it it can change state. We already have such objects like DateTImeImmutable and new proposed objects like

[PHP-DEV] Idea: immutable class / object

2014-11-25 Thread Marc Bennewitz
Hi internals, In OOP it's a sometimes a common issue to know the state of an object and to know if it was changed respectively it it can change state. We already have such objects like DateTImeImmutable and new proposed objects like UString also introduce immutable objects. I think it would