A constant is used that PHP has deprecated or removed

tx0/php:deprecated-constantrecommendedwarningreliability/api-misusedepth fastmaintainability

What it finds

A constant is used that PHP has deprecated or removed

Example from the rule's tests
<?php$name = filter_input(INPUT_GET, 'name', FILTER_SANITIZE_STRING);tx0 reports: FILTER_SANITIZE_STRING is deprecated in PHP 8.1error_reporting(E_ALL & ~E_STRICT);tx0 reports: E_STRICT is deprecated in PHP 8.4$ok = filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED);tx0 reports: FILTER_FLAG_HOST_REQUIRED is removed in PHP 8.0if (defined('E_STRICT') && constant('E_STRICT')) {    $level = E_ALL;}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/php:deprecated-constant" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/php:deprecated-constant] reason="..."

tx0 explain tx0/php:deprecated-constant shows the same in the terminal. Found a false positive? Report it.