On 26 June 2013 13:54, Robert Stoll <rst...@tutteli.ch> wrote:

> As far as I see it, it is kind of an operator overload mechanism for the
> assign operator.
> This can be useful for small utility classes such as Money, Email etc.
>
> An example was given:
> $price = new MoneyValue();
> $price := 29.99;
>
> Instead of writing something like:
> $price = new MoneyValue();
> $price->setPrice(29.99);
>
> The benefit is small, but can lead to better readable code.
>

Better readable code? It looks like you're reassigning $price, not
assigning to a property of $price. If anything it is less readable and will
lead to countless WTF moments.

Just my immediate thoughts on seeing the examples.

Regards
Peter

-- 
<hype>
WWW: plphp.dk / plind.dk
CV: careers.stackoverflow.com/peterlind
LinkedIn: plind
Twitter: kafe15
</hype>

Reply via email to