« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 1 of about 1 for defaultBehavior (0.000 sec.)
SensitiveParameter アトリビュート | PHP 8.3 9414
SensitiveParameter アトリビュート (PHP 8 >= 8.2.0) はじめに このアトリビュートを使うと、スタックトレース中に現れた場合に、 値を削除すべき秘密の値としてパラメータをマークできます。 クラス概要 #[ \Attribute ( \Attribute::TARGET_PARAMETER )] f ... inal class SensitiveParameter { /* メソッド */ public function __construct () } 例 <?php function defaultBehavior ( string $secret , string $normal ) { throw new Exception ( 'Error!' ); } function sensitiveParametersWithAttribute ( #[ \ ... SensitiveParameter ] string $secret , string $normal ) { throw new Exception ( 'Error!' ); } try { defaultBehavior ( 'password' , 'normal' ); } catch ( Exception $e ) { echo $e , PHP_EOL , PHP_EOL ; } try { sensitiveParametersWithAttribu ... 例の PHP 8.2 での出力は、たとえば以下のようになります。: Exception: Error! in example.php:7 Stack trace: #0 example.php(19): defaultBehavior('password', 'normal') #1 {main} Exception: Error! in example.php:15 Stack trace: #0 example.php(25): sensitiveParametersWi ...
https://man.mtool.work/php/8.3/class.sensitiveparameter.html
PREV 1 NEXT