Terje Slettebø wrote:
1) $result=$c1.multiply($c2).divide($c1.add($c2));

2) $result=($c1 * $c2) / ($c1 + $c2);

They sure aren't to me. Moreover, they are not the same: operator
overloading enable you to use infix notation, whereas functions use prefix,
only.

Um, you're wrong. Infix is quite easy to do using (static or non-static) functions:


3) $result = Complex::divide(Complex::multiply($c1, $c2), Complex::add($c1, $c2));

Greg

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to