RE: [PHP-DEV] Possible problem in the parser

2003-03-15 Thread Marcus Börger
At 13:01 14.03.2003, Ford, Mike [LSS] wrote: > >Just to make this completely clear, in left-associative PHP > > > >b = a==1? 4:a==2? 5:6; > > > >is equivalent to > > > >b = (a==1? 4:a==2)? 5:6; > > > NO it is not equal. Either '==' has higher precedence OR '?:' has. > See one

RE: [PHP-DEV] Possible problem in the parser

2003-03-14 Thread Ford, Mike [LSS]
> -Original Message- > From: Andi Gutmans [mailto:[EMAIL PROTECTED] > Sent: 14 March 2003 14:50 > > You are right that it doesn't behave the same as C. However, > personally > although it might have been better for it to work like C I > don't think it's > a good idea to change it now.

RE: [PHP-DEV] Possible problem in the parser

2003-03-14 Thread Jani Taskinen
On Fri, 14 Mar 2003, Andi Gutmans wrote: >You are right that it doesn't behave the same as C. However, personally >although it might have been better for it to work like C I don't think it's >a good idea to change it now. First of all it would break backwards >compatibility in a way which would

RE: [PHP-DEV] Possible problem in the parser

2003-03-14 Thread Andi Gutmans
rom: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: 13 March 2003 19:33 > To: Ford, Mike [LSS] > Cc: 'Andrey Hristov'; [EMAIL PROTECTED] > Subject: RE: [PHP-DEV] Possible problem in the parser > > > At 14:58 13.03.2003, Ford, Mike [LSS] wrote: > >

RE: [PHP-DEV] Possible problem in the parser

2003-03-14 Thread Ford, Mike [LSS]
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: 13 March 2003 19:33 > To: Ford, Mike [LSS] > Cc: 'Andrey Hristov'; [EMAIL PROTECTED] > Subject: RE: [PHP-DEV] Possible problem in the parser > > > At 14:58 13.03.2003,

RE: [PHP-DEV] Possible problem in the parser

2003-03-13 Thread Marcus Börger
At 14:58 13.03.2003, Ford, Mike [LSS] wrote: Just to make this completely clear, in left-associative PHP b = a==1? 4:a==2? 5:6; is equivalent to b = (a==1? 4:a==2)? 5:6; NO it is not equal. Either '==' has higher precedence OR '?:' has. See one of my previous mails where i

RE: [PHP-DEV] Possible problem in the parser

2003-03-13 Thread Ford, Mike [LSS]
> -Original Message- > From: Andrey Hristov [mailto:[EMAIL PROTECTED] > Sent: 12 March 2003 17:26 > > > On Wed, 12 Mar 2003, Andrey Hristov wrote: > > > > > Few minutes ago I found the following behaviour somehow > wierd for me : > > > > Known bug, the associativity of the ternary op

Re: [PHP-DEV] Possible problem in the parser

2003-03-12 Thread Andrey Hristov
gt; Cc: "Andrey Hristov" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, March 12, 2003 8:35 PM Subject: Re: [PHP-DEV] Possible problem in the parser > At 18:42 12.03.2003, Derick Rethans wrote: > >On Wed, 12 Mar 2003, Andrey Hristov wrote: > &

Re: [PHP-DEV] Possible problem in the parser

2003-03-12 Thread Marcus Börger
At 18:42 12.03.2003, Derick Rethans wrote: On Wed, 12 Mar 2003, Andrey Hristov wrote: > Few minutes ago I found the following behaviour somehow wierd for me : > $a = 1; > $b = $a==1? 4:$a==2? 5:6; > printf("a[%d]b[%d]\n", $a, $b); > ?> > Prints : > a[1]b[5] > > Similar C program : >

Re: [PHP-DEV] Possible problem in the parser

2003-03-12 Thread Derick Rethans
On Wed, 12 Mar 2003, Andrey Hristov wrote: > Few minutes ago I found the following behaviour somehow wierd for me : > $a = 1; > $b = $a==1? 4:$a==2? 5:6; > printf("a[%d]b[%d]\n", $a, $b); > ?> > Prints : > a[1]b[5] > > Similar C program : > main() > { > int a,b; > a = 1; >

Re: [PHP-DEV] Possible problem in the parser

2003-03-12 Thread Andrey Hristov
> On Wed, 12 Mar 2003, Andrey Hristov wrote: > > > Few minutes ago I found the following behaviour somehow wierd for me : > > Known bug, the associativity of the ternary operator has been > broken since ages in the engine. It's on the "won't be > fixed" sheet, because of BC concerns.

Re: [PHP-DEV] Possible problem in the parser

2003-03-12 Thread Andrey Hristov
- Original Message - From: "Sascha Schumann" <[EMAIL PROTECTED]> To: "Andrey Hristov" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, March 12, 2003 7:21 PM Subject: Re: [PHP-DEV] Possible problem in the parser > On Wed, 12 Ma

Re: [PHP-DEV] Possible problem in the parser

2003-03-12 Thread Sascha Schumann
On Wed, 12 Mar 2003, Andrey Hristov wrote: > Few minutes ago I found the following behaviour somehow wierd for me : Known bug, the associativity of the ternary operator has been broken since ages in the engine. It's on the "won't be fixed" sheet, because of BC concerns. - Sasch

[PHP-DEV] Possible problem in the parser

2003-03-12 Thread Andrey Hristov
Few minutes ago I found the following behaviour somehow wierd for me : Prints : a[1]b[5] Similar C program : main() { int a,b; a = 1; b = a==1? 4:a==2? 5:6; printf("a[%d]b[%d]\n", a, b); } Prints : a[1]b[4] -=-=-=-=-=- I think that the behavior of the C program is the right A