(PECL taint >=0.1.0)
is_tainted — Check whether a string is tainted
Checks whether the given value carries the taint mark. Only strings can
ever be tainted; any other type returns false.
stringThe value to check.
Returns true if the value is a tainted string, false otherwise.
Always returns false when
taint.enable is off.
Example #1 is_tainted() example
<?php
$name = $_GET['name'] ?? 'world';
var_dump(is_tainted($name));
?>The above example will output something similar to:
bool(true)