PHP reference to superglobal arrays

Netbeans suddenly started to issue warnings "Do not contact directly to the superglobal array $_POST ($_GET, $_SERVER)". Than it threatens and how do you get these variables?

October 3rd 19 at 02:12
4 answers
October 3rd 19 at 02:14

Habré, these issues were not...

Nothing is not threatened. Typically, the application uses the framework or libraries that provide safe access to superglobal arrays — filter/shield/lead data to the desired type. If you do not use it, then refer to the data input yourself, but never trust them.

I think Netbeans began to swear not "suddenly", and after you've changed something in the settings.

October 3rd 19 at 02:16

There is written that it is better to use, I have already switched to these recommendations, did not substantially changed in addition to improved readability in your code.

there is still added a lot of tips for Clean Code and formatting code, such as methods longer than 10 lines are highlighted, and you can quickly format the code by the specified template, if you write in a team, which adopted a style different from yours.

10 lines - I think that is not enough. At least, I think that this setting is configured. - Breanna.Schiller59 commented on October 3rd 19 at 02:19
do we have to work similar practice, in rare cases, allowed more than 10 - Letha_Streich commented on October 3rd 19 at 02:22
October 3rd 19 at 02:18

And the version?

7.4, after the last update they have introduced many chances in the CC, for example warns when a method is more than 10 lines, etc. - Breanna.Schiller59 commented on October 3rd 19 at 02:21
October 3rd 19 at 02:20

This is the right Board. In the application there is usually one global variable ($application), and to appeal directly to it is not required.

Find more questions by tags PHPNetBeans