@Larry, first of all thanks for pointing out grammar issues, I will correct
them. Now, regarding cloning of the immutable object, I'm aware of that
issue and I'm not sure if we could even use clone operation for this
purpose, I do have one proposal for that matter, consider example:
immutable class User {
public $firstname;
public $lastname;
public $email;
public function __construct($firstname, $lastname, $email){
//
}
}
$user = new User('Foo', 'Bar', '[email protected]');
$new = copy($user, ['firstname' => 'John', 'email' => '[email protected]'])
Copy function would take as a first argument an immutable object and as a
second argument associative array where keys represent property names and
values specified will be assigned to those properties on a new object.
@Marcio I will submit PR, have you found bug or?
Cheers
2016-12-11 23:35 GMT+01:00 Marcio Almada <[email protected]>:
>
> 2016-12-11 12:57 GMT-04:00 Silvio Marijić <[email protected]>:
>
>> Hi,
>>
>> Discussion is open for following rfc https://wiki.php.net/rfc/immut
>> ability
>>
>> Cheers
>>
>
>
> Hi,
>
> Can you make a pull request? I'd like to comment the patch but it's not
> possible to make inline reviews only with a diff uri on github.
>
>
--
Silvio Marijić
Software Engineer
2e Systems