Re: PHP 5.1
| From: | Stanislav Malyshev | Date: | Thu, 03 Feb 2005 11:00:13 +0000 |
| Subject: | Re: PHP 5.1 | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-14567@lists.php.net to get a copy of this message | ||
SB>> patch [1] by Johannes Schl?ter that has been floating around for a
SB>> while?
1. I personally don't think operator overloading is a good idea. It
doesn't add you anything you couldn't do without it the same way - it's
pure syntax sugar. And it really ruins the readability of the code - go
figure what $i++ means now, in absence of any type delcarations.
2. The referenced patch raises doubts - why it allows to override / but
not %, for example? What with all other operators? Why add would work as
$foo + 1, but 1 + $foo won't? Will + be non-commutative operation from now
on? What with assign-ops - it would leak memory in this case?
--
Stanislav Malyshev, Zend Products Engineer
stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115