Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67858 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3401 invoked from network); 26 Jun 2013 12:00:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jun 2013 12:00:19 -0000 Authentication-Results: pb1.pair.com smtp.mail=peter.e.lind@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=peter.e.lind@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.53 as permitted sender) X-PHP-List-Original-Sender: peter.e.lind@gmail.com X-Host-Fingerprint: 209.85.215.53 mail-la0-f53.google.com Received: from [209.85.215.53] ([209.85.215.53:53524] helo=mail-la0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/B3-18025-1D7DAC15 for ; Wed, 26 Jun 2013 08:00:18 -0400 Received: by mail-la0-f53.google.com with SMTP id fs12so13478975lab.40 for ; Wed, 26 Jun 2013 05:00:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=LxEDW/3wpLrpmnNSOOuZLci0eU0IDmsJLHRmUjrtlCc=; b=YKo/YwPDMb4sMjsSI2svd0+eGw4qcQJBRs8iw0zcfGfUE3uZQiOxqYJJ74ikHSHYTx Z7bKPC/yGVmywgkCHKfhqKK6OhXv0kUokfjeA+5w0MTqakuCCEOcb+71Yx61Uf4ZYKAi KOTA1E+VoPVPTRZ63YsJhEQ/BRAI3hH8HShpQrTy4wVsY39RSxD/JijFQ5LxQGtKsqoM hylpmqQrKZxZNlkDx7RBJSnaqdTtCSUflKsrfiXEYtjGZd/FrEblwPeN5acUX5mhgYeg 0Qxb55moFzxsi5Pf7c6DHjIkMMoMCY8VxM+4Up6Kip246CppyH/JFjZmqC/Deyep9Hk5 6esA== X-Received: by 10.152.37.138 with SMTP id y10mr1728422laj.40.1372248014318; Wed, 26 Jun 2013 05:00:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.127.41 with HTTP; Wed, 26 Jun 2013 04:59:54 -0700 (PDT) In-Reply-To: <001b01ce7263$da79fec0$8f6dfc40$@tutteli.ch> References: <001b01ce7263$da79fec0$8f6dfc40$@tutteli.ch> Date: Wed, 26 Jun 2013 13:59:54 +0200 Message-ID: To: Robert Stoll Cc: Richard Quadling , Tom Oram , PHP internals Content-Type: multipart/alternative; boundary=089e0141abf46ff0a504e00d63ec Subject: Re: [PHP-DEV] RFC Proposal: New assign value operator From: peter.e.lind@gmail.com (Peter Lind) --089e0141abf46ff0a504e00d63ec Content-Type: text/plain; charset=UTF-8 On 26 June 2013 13:54, Robert Stoll 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 -- WWW: plphp.dk / plind.dk CV: careers.stackoverflow.com/peterlind LinkedIn: plind Twitter: kafe15 --089e0141abf46ff0a504e00d63ec--