Re: Implementation (simple!) operator overloading
| From: | Stanislav Malyshev | Date: | Mon, 10 Jul 2000 07:54:41 +0000 |
| Subject: | Re: Implementation (simple!) operator overloading | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-24002@lists.php.net to get a copy of this message | ||
MK(>> Uhm, unreadable?
MK(>> the &?& stuff was unreadable, this to my opinion is
MK(>> pretty much straight to the point.. add/substract something
Not at all. Tell me, what is $a + $b thet you see in the code? Now it's
numerical addition, with operator overloading this could be file copy,
matrix addition, graph merge or anything I even afraid to think
about. You'd have to trace back all the code to see types of $a and $b and
the decide. Also, because PHP has no typed function prototypes, you
probably can't do funny things and in C++ anyway, and you probably would
have hard time making $a + $b == $b + $a again (what any person
familiar with ariphmetic would expect). That's why it's unreadable. That's
like obfuscated C contest - looks pretty if you don't need to understand
how it works.
--
Stanislav Malyshev stas@zend.com
+972-3-6139665