rspec/rules/S1600/php/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

51 lines
1.3 KiB
Plaintext

== Why is this an issue?
Deprecated predefined variables in PHP should not be used because they may lead to compatibility issues and unpredictable behavior in future versions of PHP.
Relying on deprecated variables can result in code that is difficult to maintain and may break when migrating to newer PHP versions.
It is recommended to use the recommended alternatives or custom variables to ensure long-term compatibility and stability of PHP code.
== How to fix it
The following predefined variables are deprecated and should be replaced by the new versions:
[frame=all]
[cols="^1,^1"]
|===
|Replace|With
|$HTTP_SERVER_VARS|$_SERVER
|$HTTP_GET_VARS|$_GET
|$HTTP_POST_VARS|$_POST
|$HTTP_POST_FILES|$_FILES
|$HTTP_SESSION_VARS|$_SESSION
|$HTTP_ENV_VARS|$_ENV
|$HTTP_COOKIE_VARS|$_COOKIE
|$php_errormsg|error_get_last()
|===
== Resources
=== Documentation
* https://www.php.net/manual/en/reserved.variables.php[PHP Manual - Predefined Variables]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Replace this use of the deprecated "XXXXXX" variable with "YYYYY".
'''
== Comments And Links
(visible only on this page)
=== on 12 Feb 2014, 20:38:17 Freddy Mallet wrote:
Is implemented by \http://jira.codehaus.org/browse/SONARPLUGINS-2338
endif::env-github,rspecator-view[]