Re: Implementation (simple!) operator overloading
| From: | ggInternet) | Date: | Mon, 10 Jul 2000 08:00:44 +0000 |
| Subject: | Re: Implementation (simple!) operator overloading | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-24003@lists.php.net to get a copy of this message | ||
Well actually, you can do some funny stuff
adding and substracting (property) strings..
($object->string = $object - 10)
(I'm kinda working on the $object -= 10; )
Bout the type thing, well you can imagine types right..
Anyway, I see there isn't much interest for it, so it was a nice
exercise anyways.. I'm interested in improving PHP's OO capabilities
but I get the feeling OO is not really wanted in PHP by the developers
in here, this true?
CaPS
On Mon, 10 Jul 2000, Stanislav Malyshev wrote:
> 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
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>