Skip to content

Commit 8d49e30

Browse files
lacatoirecweiske
authored andcommitted
Document ValueError thrown by settype() since PHP 8.0
Add Errors/Exceptions section and changelog entry. Fixes #3431
1 parent ae90ecc commit 8d49e30

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

reference/var/functions/settype.xml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,41 @@
8787
</para>
8888
</refsect1>
8989

90+
<refsect1 role="errors">
91+
&reftitle.errors;
92+
<para>
93+
Throws a <exceptionname>ValueError</exceptionname> if the value of
94+
<parameter>type</parameter> is not a valid type, as of PHP 8.0.0.
95+
Prior to PHP 8.0.0, a <constant>E_WARNING</constant> was emitted
96+
and &false; was returned.
97+
</para>
98+
</refsect1>
99+
100+
<refsect1 role="changelog">
101+
&reftitle.changelog;
102+
<informaltable>
103+
<tgroup cols="2">
104+
<thead>
105+
<row>
106+
<entry>&Version;</entry>
107+
<entry>&Description;</entry>
108+
</row>
109+
</thead>
110+
<tbody>
111+
<row>
112+
<entry>8.0.0</entry>
113+
<entry>
114+
Now throws a <exceptionname>ValueError</exceptionname> when an invalid
115+
type is passed to <parameter>type</parameter>. Previously, a
116+
<constant>E_WARNING</constant> was emitted and the function returned
117+
&false;.
118+
</entry>
119+
</row>
120+
</tbody>
121+
</tgroup>
122+
</informaltable>
123+
</refsect1>
124+
90125
<refsect1 role="examples">
91126
&reftitle.examples;
92127
<para>

0 commit comments

Comments
 (0)