46
46
The designated error type for this error. It only works with the <constant >E_USER_<replaceable >*</replaceable ></constant >
47
47
family of constants, and will default to <constant >E_USER_NOTICE</constant >.
48
48
</para >
49
+ <warning >
50
+ <simpara >
51
+ Passing <constant >E_USER_ERROR</constant > as the
52
+ <parameter >error_level</parameter > is now deprecated.
53
+ Throw an <exceptionname >Exception</exceptionname > or
54
+ call <function >exit</function > instead.
55
+ </simpara >
56
+ </warning >
49
57
</listitem >
50
58
</varlistentry >
51
59
</variablelist >
80
88
</row >
81
89
</thead >
82
90
<tbody >
91
+ <row >
92
+ <entry >8.4.0</entry >
93
+ <entry >
94
+ Passing <constant >E_USER_ERROR</constant > as the
95
+ <parameter >error_level</parameter > is now deprecated.
96
+ Throw an <exceptionname >Exception</exceptionname > or
97
+ call <function >exit</function > instead.
98
+ </entry >
99
+ </row >
100
+ <row >
101
+ <entry >8.4.0</entry >
102
+ <entry >
103
+ The function now has a return type of <type >true</type >
104
+ instead of <type >bool</type >.
105
+ </entry >
106
+ </row >
83
107
<row >
84
108
<entry >8.0.0</entry >
85
109
<entry >
103
127
<programlisting role =" php" >
104
128
<![CDATA[
105
129
<?php
106
- if ($divisor == 0) {
107
- trigger_error("Cannot divide by zero", E_USER_ERROR);
130
+ $password = $_POST['password'] ?? '';
131
+ if ($password === '') {
132
+ trigger_error("Using an empty password is unsafe", E_USER_WARNING);
108
133
}
134
+ $hash = password_hash($password, PASSWORD_DEFAULT);
109
135
?>
110
136
]]>
111
137
</programlisting >
@@ -132,6 +158,7 @@ if ($divisor == 0) {
132
158
<member ><function >set_error_handler</function ></member >
133
159
<member ><function >restore_error_handler</function ></member >
134
160
<member >The <link linkend =" errorfunc.constants" >error level constants</link ></member >
161
+ <member >The <classname >Deprecated</classname > attribute</member >
135
162
</simplelist >
136
163
</para >
137
164
</refsect1 >
0 commit comments