Hide Sensitive Parameter

../_images/sensitiveParameter.png

PHP 8.2 introduces the #[SensitiveParameter] attribute to hide sensitive values from debug messages when used on function parameters. Additionally, the SensitiveParameterValue class allows you to mark data as sensitive at the caller level, ensuring it won’t appear in stack traces. To retrieve the original value when needed, simply call the $object->getValue() method.

See Also

PHP Features