Re: Re: Patch-tastic!
| From: | Jason T. Greene | Date: | Wed, 05 Jun 2002 14:41:45 +0000 |
| Subject: | Re: Re: Patch-tastic! | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-84894@lists.php.net to get a copy of this message | ||
If '+' concatenates what does '-' do?
: )
-Jason
On Wed, 2002-06-05 at 09:39, Andrei Zmievski wrote:
> > > The latest one changes some operators.
> >
> > Nice, but why not overload + for strings to do the concatenation?
>
> Doing that would be ambiguous, to say the least. PHP automatically
> converts operand types with arithmetic + operator. What would you expect
> the result of the following expressions to be:
>
> "1" + "2"
> 1 + "2"
> "2" + $a
>
> -Andrei ð_‡ÔŒ]Ò
> ~NÕšp¤thttp://www.gravitonic.com/
> * 2 + 2 = 5 for extremely large values of 2. *
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>