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
> -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.
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
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:
>
>
> -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,
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
> -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
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:
> &
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 :
>
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;
>
> 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.
- 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
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
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
14 matches
Mail list logo