mirror of
https://github.com/php/doc-en.git
synced 2026-03-23 23:32:18 +01:00
Replace <literal>true/false</literal> by their respective entities (#2399)
* Replace <literal>true/false</literal> by their respective entities * Fixes
This commit is contained in:
@@ -211,7 +211,7 @@ switch ($target) {
|
||||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
For more complex comparisons, the value <literal>true</literal> may be used as the switch value.
|
||||
For more complex comparisons, the value &true; may be used as the switch value.
|
||||
Or, alternatively, <literal>if</literal>-<literal>else</literal> blocks instead of <literal>switch</literal>.
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
|
||||
@@ -678,7 +678,7 @@ print serialize(Suit::Hearts);
|
||||
|
||||
<para>
|
||||
On deserialization, if an enum and case cannot be found to match a serialized
|
||||
value a warning will be issued and <literal>false</literal> returned.</para>
|
||||
value a warning will be issued and &false; returned.</para>
|
||||
|
||||
<para>
|
||||
If a Pure Enum is serialized to JSON, an error will be thrown. If a Backed Enum
|
||||
|
||||
@@ -102,8 +102,8 @@ $array = [
|
||||
<listitem>
|
||||
<simpara>
|
||||
<type>Bool</type>s are cast to <type>int</type>s, too, i.e. the key
|
||||
<literal>true</literal> will actually be stored under <literal>1</literal>
|
||||
and the key <literal>false</literal> under <literal>0</literal>.
|
||||
&true; will actually be stored under <literal>1</literal>
|
||||
and the key &false; under <literal>0</literal>.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
|
||||
@@ -260,18 +260,18 @@ Stack trace:
|
||||
<title>Union types</title>
|
||||
<warning>
|
||||
<simpara>
|
||||
It is not possible to combine the two literal types <literal>false</literal>
|
||||
and <literal>true</literal> together in a union type.
|
||||
It is not possible to combine the two literal types <type>false</type>
|
||||
and <type>true</type> together in a union type.
|
||||
Use <type>bool</type> instead.
|
||||
</simpara>
|
||||
</warning>
|
||||
|
||||
<caution>
|
||||
<simpara>
|
||||
Prior to PHP 8.2.0, as <literal>false</literal> and <type>null</type>
|
||||
Prior to PHP 8.2.0, as <type>false</type> and <type>null</type>
|
||||
could not be used as standalone types, a union type comprised of only
|
||||
these types was not permitted. This comprises the following types:
|
||||
<literal>false</literal>, <literal>false|null</literal>,
|
||||
<type>false</type>, <literal>false|null</literal>,
|
||||
and <literal>?false</literal>.
|
||||
</simpara>
|
||||
</caution>
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
<para>
|
||||
Literal types are type which not only check the type of a value but also
|
||||
the value itself. PHP has support for two literal types:
|
||||
<literal>false</literal> as of PHP 8.0.0, and <literal>true</literal>
|
||||
<type>false</type> as of PHP 8.0.0, and <type>true</type>
|
||||
as of PHP 8.2.0.
|
||||
</para>
|
||||
|
||||
<warning>
|
||||
<simpara>
|
||||
Prior to PHP 8.2.0 the <literal>false</literal> type could only be used as part of a
|
||||
Prior to PHP 8.2.0 the <type>false</type> type could only be used as part of a
|
||||
<link linkend="language.types.type-system.composite.union">union type</link>.
|
||||
</simpara>
|
||||
</warning>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns an <type>array</type> of values returned by the Lua function, which may be empty, or <literal>false</literal> in case of failure.
|
||||
Returns an <type>array</type> of values returned by the Lua function, which may be empty, &return.falseforfailure;.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<term><parameter>limit</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Limit as a <type>float</type> in seconds, or <literal>false</literal> for no limit.
|
||||
Limit as a <type>float</type> in seconds, or &false; for no limit.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</para>
|
||||
<para>
|
||||
Errors considered to be the fault of the PHP code will result in the
|
||||
function returning <literal>false</literal> and <constant>E_WARNING</constant>
|
||||
function returning &false; and <constant>E_WARNING</constant>
|
||||
being raised, for example, a <type>resource</type> type being used as an
|
||||
argument. Lua errors will result in a <classname>LuaSandboxRuntimeError</classname>
|
||||
exception being thrown.
|
||||
@@ -133,7 +133,7 @@
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns an <type>array</type> of values returned by the function, which may be empty,
|
||||
or <literal>false</literal> on error.
|
||||
&return.falseforfailure;.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
@@ -67,8 +67,8 @@
|
||||
<warning>
|
||||
<simpara>
|
||||
Defining case-insensitive constants is deprecated as of PHP 7.3.0.
|
||||
As of PHP 8.0.0, only <literal>false</literal> is an acceptable value, passing
|
||||
<literal>true</literal> will produce a warning.
|
||||
As of PHP 8.0.0, only &false; is an acceptable value, passing
|
||||
&true; will produce a warning.
|
||||
</simpara>
|
||||
</warning>
|
||||
<note>
|
||||
|
||||
@@ -784,7 +784,7 @@ class UpperClass implements MongoDB\BSON\Persistable {
|
||||
The <methodname>MongoDB\BSON\Unserializable::bsonUnserialize</methodname>
|
||||
method of YourClass, OurClass, TheirClass iterate over the array and set
|
||||
the properties without modifications. It <emphasis>also</emphasis> sets
|
||||
the <literal>$unserialized</literal> property to <literal>true</literal>:
|
||||
the <literal>$unserialized</literal> property to &true;:
|
||||
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<term><parameter>enable</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>true</literal> to turn implicit flushing on, <literal>false</literal> otherwise.
|
||||
&true; to turn implicit flushing on, &false; otherwise.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -140,8 +140,8 @@
|
||||
<term>linebreak (parameter)</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Set to <literal>true</literal> if you want a carriage return to start a new line instead
|
||||
of treating it as a space. Defaults to <literal>false</literal>.
|
||||
Set to &true; if you want a carriage return to start a new line instead
|
||||
of treating it as a space. Defaults to &false;.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -149,8 +149,8 @@
|
||||
<term>parbreak (parameter)</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Set to <literal>true</literal> if you want a carriage return on a single line to start a
|
||||
new paragraph instead of treating it as a space. Defaults to <literal>true</literal>.
|
||||
Set to &true; if you want a carriage return on a single line to start a
|
||||
new paragraph instead of treating it as a space. Defaults to &true;.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -158,9 +158,9 @@
|
||||
<term>hyphenation (parameter)</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Set to <literal>true</literal> in order to turn hyphenation on. This requires a
|
||||
Set to &true; in order to turn hyphenation on. This requires a
|
||||
dictionary to be set with the parameter <parameter>hyphendict</parameter>. Defaults to
|
||||
<literal>false</literal>.
|
||||
&false;.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -44,8 +44,8 @@
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies if the process shouldn't wait for the semaphore to be acquired.
|
||||
If set to <literal>true</literal>, the call will return
|
||||
<literal>false</literal> immediately if a semaphore cannot be immediately
|
||||
If set to &true;, the call will return
|
||||
&false; immediately if a semaphore cannot be immediately
|
||||
acquired.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
Reference in New Issue
Block a user