1
1
<?xml version =" 1.0" encoding =" utf-8" ?>
2
2
<!-- $Revision$ -->
3
- <!-- EN-Revision: 210d382b5b139444fe2e16a5a3211076a65ff2ba Maintainer: hirokawa Status: ready -->
3
+ <!-- EN-Revision: 72b70d7c3c3b2b87423641906da2db407c32c3c3 Maintainer: hirokawa Status: ready -->
4
4
<!-- CREDITS: takagi -->
5
5
<refentry xml : id =" function.trigger-error" xmlns =" http://docbook.org/ns/docbook" >
6
6
<refnamediv >
42
42
<para >
43
43
このエラーに割り当てられたエラー型です。<constant >E_USER_<replaceable >*</replaceable ></constant > の定数のみが指定可能で、デフォルトは <constant >E_USER_NOTICE</constant > です。
44
44
</para >
45
+ <warning >
46
+ <simpara >
47
+ <parameter >error_level</parameter > として
48
+ <constant >E_USER_ERROR</constant > を指定するのは非推奨となりました。
49
+ かわりに、<exceptionname >Exception</exceptionname > をスローするか、
50
+ <function >exit</function > を呼び出してください。
51
+ </simpara >
52
+ </warning >
45
53
</listitem >
46
54
</varlistentry >
47
55
</variablelist >
77
85
</row >
78
86
</thead >
79
87
<tbody >
88
+ <row >
89
+ <entry >8.4.0</entry >
90
+ <entry >
91
+ <parameter >error_level</parameter > として
92
+ <constant >E_USER_ERROR</constant > を指定するのは非推奨となりました。
93
+ かわりに、<exceptionname >Exception</exceptionname > をスローするか、
94
+ <function >exit</function > を呼び出してください。
95
+ </entry >
96
+ </row >
97
+ <row >
98
+ <entry >8.4.0</entry >
99
+ <entry >
100
+ 戻り値の型が、<type >bool</type > ではなく
101
+ <type >true</type > に変更されました。
102
+ </entry >
103
+ </row >
80
104
<row >
81
105
<entry >8.0.0</entry >
82
106
<entry >
102
126
<programlisting role =" php" >
103
127
<![CDATA[
104
128
<?php
105
- if ($divisor == 0) {
106
- trigger_error("ゼロで割ることはできません", E_USER_ERROR);
129
+ $password = $_POST['password'] ?? '';
130
+ if ($password === '') {
131
+ trigger_error("空のパスワードを使用することは安全ではありません", E_USER_WARNING);
107
132
}
133
+ $hash = password_hash($password, PASSWORD_DEFAULT);
108
134
?>
109
135
]]>
110
136
</programlisting >
@@ -129,6 +155,7 @@ if ($divisor == 0) {
129
155
<member ><function >set_error_handler</function ></member >
130
156
<member ><function >restore_error_handler</function ></member >
131
157
<member ><link linkend =" errorfunc.constants" >エラーレベル定数</link ></member >
158
+ <member ><classname >Deprecated</classname > アトリビュート</member >
132
159
</simplelist >
133
160
</para >
134
161
</refsect1 >
0 commit comments