mirror of
https://github.com/php/doc-en.git
synced 2026-03-26 16:52:25 +01:00
Fix GH-1182: constant() throws Error exception as of PHP 8.0.0
This commit is contained in:
@@ -46,19 +46,43 @@
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns the value of the constant, or &null; if the constant is not
|
||||
defined.
|
||||
Returns the value of the constant.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="errors">
|
||||
&reftitle.errors;
|
||||
<para>
|
||||
An <constant>E_WARNING</constant> level error is generated if the
|
||||
constant is not defined.
|
||||
An <classname>Error</classname> exception is thrown,
|
||||
if the constant is not defined. Prior to PHP 8.0.0,
|
||||
an <constant>E_WARNING</constant> level error was generated in that case.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
&reftitle.changelog;
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>8.0.0</entry>
|
||||
<entry>
|
||||
If the constant is not defined, <function>constant</function> now throws an
|
||||
<classname>Error</classname> exception; previously an <constant>E_WARNING</constant>
|
||||
was generated, and &null; was returned.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
|
||||
Reference in New Issue
Block a user