ID:               44934
 User updated by:  php at hristov dot com
 Reported By:      php at hristov dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         Feature/Change Request
 Operating System: All
 PHP Version:      5.3CVS-2008-05-07 (CVS)
 New Comment:

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


Previous Comments:
------------------------------------------------------------------------

[2008-05-07 15:07:50] [EMAIL PROTECTED]

Other than cause a parse error of course..

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

[2008-05-07 15:06:55] [EMAIL PROTECTED]

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] [EMAIL PROTECTED]

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.

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

[2008-05-07 14:47:42] [EMAIL PROTECTED]

If introduced while not completely?

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

[2008-05-07 14:26:17] [EMAIL PROTECTED]

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

The ternary operator is not supposed to support that syntax, and it
doesn't.
So this is not a bug, and I'm not sure it's a good feature request
either: ternary syntax is suited for simple cases. But if you really
think it should be implemented, file a feature request.

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

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
    http://bugs.php.net/44934

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

Reply via email to