Possible problem in the parser
| From: | Andrey Hristov | Date: | Wed, 12 Mar 2003 17:18:38 +0000 |
| Subject: | Possible problem in the parser | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-95066@lists.php.net to get a copy of this message | ||
Few minutes ago I found the following behaviour somehow wierd for me :
<?php
$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;
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
Andrey