Re: [Zend Engine 2] RFC: Conversion patch

From: Date: Tue, 26 Nov 2002 21:41:24 +0000
Subject: Re: [Zend Engine 2] RFC: Conversion patch
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-91773@lists.php.net to get a copy of this message
So why do the conversion in arithmetic? This seems bizarrely inconsistent to me: <? print (int) "0xA" + 0; // prints 0 print (int) ("0xA" + 0); // prints 10 ?> I think it's reasonable to expect those expressions to return the same value. On Tue, 26 Nov 2002, Andi Gutmans wrote: > > http://marc.theaimsgroup.com/?l=php-dev&m=90279104406264&w=2 > > There's more... > > Andi > > At 10:21 PM 11/26/2002 +0100, Derick Rethans wrote: > >On Tue, 26 Nov 2002, Andi Gutmans wrote: > > > > > I remember having a long conversation on this issue quite a long time ago. > > > I think it was on php-dev. The bottom line was that we only want > > conversion > > > in the scanner and not within PHP. > > > >Too bad, because the following thing is totally uninituitive: > > > >echo (int)"0x200"; > > > >(prints "0") > > > >And I searched for a discussion on this, but couldnt' find it. I wonder > >why it was decided to be like this. > > > >Derick > > > >-- > > > >------------------------------------------------------------------------- > > Derick Rethans > > http://derickrethans.nl/ > > JDI Media Solutions > > http://www.jdimedia.nl/ > > PHP Magazine - PHP Magazine for Professionals > > http://php-mag.net/ > >------------------------------------------------------------------------- > >

« previous php.dev (#91773) next »