ID: 38723 Updated by: [EMAIL PROTECTED] Reported By: z_rules55 at hotmail dot com -Status: Open +Status: Closed Bug Type: Documentation problem PHP Version: Irrelevant -Assigned To: +Assigned To: colder New Comment:
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. Parentheses are in fact not required at all in that case. Previous Comments: ------------------------------------------------------------------------ [2006-09-05 13:24:55] z_rules55 at hotmail dot com Description: ------------ The docs section on "return" (http://us3.php.net/manual/en/function.return.php) states that: "Note that since return() is a language construct and not a function, the parentheses surrounding its arguments are only required if the argument contains an expression. It is common to leave them out while returning a variable, and you actually should as PHP has less work to do in this case." But the docs on what an expression *is* (http://us3.php.net/manual/en/language.expressions.php) say that: "In PHP, almost anything you write is an expression. The simplest yet most accurate way to define an expression is "anything that has a value"." And then goes on to say that the literal '5' is an expression. It's confusing. What, then, is an expression in PHP? If parentheses are required when returning the value of an expression, does that mean an expression as in a calculation (return (1 + 2)), or an assignment (return ($GLOBALS['a'] = $b)), or a function call (return (funky_function())), or what? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38723&edit=1