Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67867 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22698 invoked from network); 26 Jun 2013 13:35:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jun 2013 13:35:53 -0000 Authentication-Results: pb1.pair.com header.from=indeyets@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=indeyets@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.50 as permitted sender) X-PHP-List-Original-Sender: indeyets@gmail.com X-Host-Fingerprint: 209.85.215.50 mail-la0-f50.google.com Received: from [209.85.215.50] ([209.85.215.50:63078] helo=mail-la0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F4/87-18025-73EEAC15 for ; Wed, 26 Jun 2013 09:35:52 -0400 Received: by mail-la0-f50.google.com with SMTP id dy20so13596883lab.37 for ; Wed, 26 Jun 2013 06:35:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=yDXoeeW+sAubUxoBsdhxlkgKvl5o8lSYvRJ0Rra51TU=; b=rHhmR0p54YyDBKEtL5C0Gq+A2bU3gM4G6WmfLXL5mHSp7pmMHBzuJuwdrgOgbXlMdM arEvM/S5Af8KWT/MgmnQ3KzAxcn7AK+boyjWj4xsvMhObc6fdsU0rthPUV7x+15zcgaO eDx/L/EJXujOU5a+tAK7dqvEKI5yeQFbg3SzQuF22gzqt1cXsT0xFCsnPYNevNXnfvxr 3/EImxc5JOM4syInXFNSKDthMGqqWsgR07CewiQHlf2Fs5+gsJWqV71tgp7XTKy4MRu3 yjQWAlZwohLoQgFOKvsIXrXJSCLSwMtiH8fw3UtO+YkaSFaNaHOwTAKJDBjgxYSdyS4Y HAAw== X-Received: by 10.112.50.77 with SMTP id a13mr2138400lbo.46.1372253748080; Wed, 26 Jun 2013 06:35:48 -0700 (PDT) Received: from [10.0.1.7] ([46.252.161.106]) by mx.google.com with ESMTPSA id g7sm10814640lae.6.2013.06.26.06.35.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Jun 2013 06:35:46 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) In-Reply-To: Date: Wed, 26 Jun 2013 17:35:44 +0400 Cc: Robert Stoll , Richard Quadling , Tom Oram , PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: <80C275B1-88DF-461D-9CAA-4D5FF393234F@gmail.com> References: <001b01ce7263$da79fec0$8f6dfc40$@tutteli.ch> To: Sebastian Krebs X-Mailer: Apple Mail (2.1508) Subject: Re: [PHP-DEV] RFC Proposal: New assign value operator From: indeyets@gmail.com (Alexey Zakhlestin) On 26.06.2013, at 17:29, Sebastian Krebs wrote: > 2013/6/26 Robert Stoll >=20 >> 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. >>=20 >> An example was given: >> $price =3D new MoneyValue(); >> $price :=3D 29.99; >>=20 >> Instead of writing something like: >> $price =3D new MoneyValue(); >> $price->setPrice(29.99); >>=20 >> The benefit is small, but can lead to better readable code. But since = it >> is only for the assign operator and not for + - etc., for me the = question >> remains open why not writing something like this directly: >>=20 >> $price =3D new MoneyValue(29.99); >>=20 >=20 > You forgot the currency ;) (without it a "money"-type is useless). But = this > leads to >=20 > $price :=3D 29.99; > $price :=3D 'USD'; >=20 > I find it confusing. Not to mention, that one should NEVER use float for money = http://stackoverflow.com/questions/3730019/why-not-use-double-or-float-to-= represent-currency --=20 Alexey Zakhlestin CTO at Grids.by/you https://github.com/indeyets PGP key: http://indeyets.ru/alexey.zakhlestin.pgp.asc