update page now

The SensitiveParameterValue class

(PHP 8 >= 8.2.0)

简介

The SensitiveParameterValue class allows wrapping sensitive values to protect them against accidental exposure.

Values of parameters having the SensitiveParameter attribute will automatically be wrapped inside of a SensitiveParameterValue object within stack traces.

类摘要

final class SensitiveParameterValue {
/* 属性 */
private readonly mixed $value;
/* 方法 */
public __construct(mixed $value)
public __debugInfo(): array
public getValue(): mixed
}

属性

value

The sensitive value to be protected against accidental exposure.

目录

添加备注

用户贡献的备注 1 note

up
0
fossalta at xs4all dot nl
1 day ago
While this class protects against accidental echo and/or var_dump, it does NOT protect against some other php functions:

<?php
$value = new SensitiveParameterValue('MyPassword');

var_dump($value); // Safe

echo $value; // PHP error: could not be converted to string

var_dump(get_mangled_object_vars($value)); // Password exposed!!!
?>
To Top