|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #71701 Misleading indentation warning
Submitted: 2016-03-02 12:13 UTC Modified: 2016-03-02 23:45 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: daniel dot nagy at mirror dot hu Assigned:
Status: Wont fix Package: Compile Warning
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2016-03-02 12:13 UTC] daniel dot nagy at mirror dot hu
GCC 6 recently introduced a new compiler warning for misleading indentation in codes. It would be really great if PHP would also include this warning (maybe disabled by default?).
See more here:

Test script:
if (some_condition())


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-03-02 23:45 UTC]
-Status: Open +Status: Wont fix
 [2016-03-02 23:45 UTC]
This is the kind of thing that would be best suited by a sort of code analysis tool - not baked into the PHP engine. Those kinds of tools could also detect other sorts of code "errors", such as not following some defined coding style. It's not like we're Python :D

There are a bunch out there. Find one (or more) you like, see if it supports checking indentation levels, and if not then you should suggest the feature to the maintainer.

IDEs that support PHP are worth a check too as that'd be the best place for a programmer to find out about mistakes. I personally use NetBeans and its PHP addon supports many different inline warnings ("hints") as well as a few third-party analysis tools.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 28 07:01:29 2024 UTC