For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > March 2006 > #36877 [Opn]: comma in expr1 undocumented in for ($i=1,$n=10;









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #36877 [Opn]: comma in expr1 undocumented in for ($i=1,$n=10;
php-bugs at t43 dot mine dot nu

2006-03-30, 6:58 pm

ID: 36877
User updated by: php-bugs at t43 dot mine dot nu
Reported By: php-bugs at t43 dot mine dot nu
Status: Open
Bug Type: Documentation problem
Operating System: na
PHP Version: Irrelevant
New Comment:

It is however true that it executes as arpad described.


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

[2006-03-30 19:08:43] php-bugs at t43 dot mine dot nu

IMHO
(1) should only be documented what is intended. ZEND should say about
comma in expr2 before it makes it into the manual. Such deviation from
C should be intentional if at all.
(2) in C++, by 5.2 of its definition, only assigments can be
comma-sequenced. Simple boolean expressions are not yet assignments.
The value of a sequenced expression is the value of the last assigment,
not an OR of them.
(3) it would be more logical to give comma in expr-2 the meaning of
AND: continue while (data available AND buffer available). But better
nothing.

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

[2006-03-30 16:30:09] colder@php.net

Thanks for the note arpad,

here is the updated patch:

http://patches.colder.ch/control-structures-for-2.patch

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

[2006-03-30 11:33:58] arpad@php.net

You can use a comma in expr2 too, it's equivalent to || but much lower
in precedence.

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

[2006-03-30 09:29:48] php-bugs at t43 dot mine dot nu

I thank you sincerely for the answer.

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

[2006-03-30 04:10:15] simp@php.net

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation
better.

thanks for the patch

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

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/36877

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







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com