|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #60698 Explicitly discouraging parethenses for arguments in some language constructs
Submitted: 2012-01-10 10:51 UTC Modified: 2013-10-06 07:33 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: phpmpan at mpan dot pl Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: phpmpan at mpan dot pl
New email:
PHP Version: OS:


 [2012-01-10 10:51 UTC] phpmpan at mpan dot pl
Bug#60694 (and not only it) shows that users too often misinterpret parenthenses around arguments for the following language constructs:
 - echo
 - print
 - include
 - include_once
 - require
 - require_once
Documentation for those things should include warning about the issue (not necessarily the red warning box, a simple sentence should be enough).

Currently there is a notice that multiple arguments for `echo` should not be enclosed in parenthenses and. Also docs for `include` family warn about a case when the return value is used in an expression. However I believe this is insufficient and should be replaced with an explicit warning.

Bug#52722 is related.

Expected result:
Users should not misinterpret code

Actual result:
Users misinterpret code, because of parenthenses around arguments


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-06 07:32 UTC]
-Status: Open +Status: Not a bug
 [2013-10-06 07:32 UTC]
Using language constructs expressively is only supported by some language constructs,
 [2013-10-06 07:33 UTC]
sorry about the break in message ...

Those that do support it document sufficiently the use of parenthesis when using the construct expressively.

This is sufficient.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Apr 14 09:01:24 2021 UTC