Hi all,
I once suggested to some core developers to offer « clone » the same syntax as « new » has since 5.4.
The idea being to be able to write this kind of code:
$foo = new Foo;
$bar = (clone $foo)->someMethod();
It seemed that this would not be that difficult to implement, and I was told that a RFC will be created for that purpose.
As I can’t find any RFC for that, I was wondering whether I should create one myself or if I just didn’t find it :)
Thanks,
Gauthier
On Mon, Oct 5, 2015 at 9:48 AM, Gauthier Delamarre gdelamarre@gmail.com
wrote:
Hi all,
I once suggested to some core developers to offer « clone » the same
syntax as « new » has since 5.4.The idea being to be able to write this kind of code:
$foo = new Foo;
$bar = (clone $foo)->someMethod();It seemed that this would not be that difficult to implement, and I was
told that a RFC will be created for that purpose.As I can’t find any RFC for that, I was wondering whether I should create
one myself or if I just didn’t find it :)
Support for this was part of the UVS RFC (
https://wiki.php.net/rfc/uniform_variable_syntax), so this will work in PHP
7 :)
Nikita