Edit report at https://bugs.php.net/bug.php?id=44934&edit=1

 ID:                 44934
 Updated by:         ni...@php.net
 Reported by:        php at hristov dot com
 Summary:            The parser doesn't parse a comma
-Status:             Open
+Status:             Wont fix
 Type:               Feature/Change Request
-Package:            Feature/Change Request
+Package:            *General Issues
 Operating System:   All
 PHP Version:        5.3CVS-2008-05-07 (CVS)
 Block user comment: N
 Private report:     N

 New Comment:

No need for the comma operator in PHP, only serves to confuse people. Marking 
as Wfx.


Previous Comments:
------------------------------------------------------------------------
[2008-05-07 15:47:45] tony2...@php.net

Oh, please no need to add THAT kind of unreadable syntax, we have enough of it 
already.
This one is really ugly and more important - useless.

------------------------------------------------------------------------
[2008-05-07 15:27:54] php at hristov dot com

Give you "2" as result.
This is just an example, to simplify what is wanted, not something you will 
find somewhere.

------------------------------------------------------------------------
[2008-05-07 15:07:50] j...@php.net

Other than cause a parse error of course..

------------------------------------------------------------------------
[2008-05-07 15:06:55] j...@php.net

What exactly is supposed to happen with that php code above? 
I mean, whatta hell is $b = ($a, 1); supposed to do?

------------------------------------------------------------------------
[2008-05-07 14:55:23] and...@php.net

To make it even easier for testing :
./php -r '$a=1; $b = ($a, 2);'

The equivalent in C is:
#include <stdio.h>
int main(void)
{
  int a = 1, c;
  c = (a, 2);
  printf("%d\n", c);
}

"," has lower prio than =, thus the brackets.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=44934


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=44934&edit=1

Reply via email to