Req #71701 [Opn->Wfx]: Misleading indentation warning
Edit report at https://bugs.php.net/bug.php?id=71701&edit=1
ID: 71701
Updated by: requinix@php.net
Reported by: daniel dot nagy at mirror dot hu
Summary: Misleading indentation warning
-Status: Open
+Status: Wont fix
Type: Feature/Change Request
Package: Compile Warning
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2016-03-02 12:13:06] daniel dot nagy at mirror dot hu
Description:
------------
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: http://developerblog.redhat.com/2016/02/26/gcc-6-wmisleading-indentation-vs-goto-fail/
Test script:
---------------
if (some_condition())
do_foo();
do_bar();
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71701&edit=1
Thread (2 messages)