Re: RFC proposal - Syntactic sugar for cloning
| From: | Johannes Schlüter | Date: | Fri, 29 Jun 2012 14:50:45 +0000 |
| Subject: | Re: RFC proposal - Syntactic sugar for cloning | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-61041@lists.php.net to get a copy of this message | ||
On Fri, 2012-06-29 at 16:25 +0200, Amaury Bouchard wrote:
> Back in the real world, we are not cloning objects very often. But, like
> many other syntactic sugars (as the short array syntax), I think it could
> be handy in some circumstances.
Well, arrays are used all over the place. As you said: cloning is not.
Also this patch only covers one use case, the assignment of an copy. I
does not cover other cases, like cloning in an function call
foo(clone $obj);
etc. So I see little need for that sugar, it will mostly hurt the teeth
(to stay in the picture)
johannes