Fix GH-1571: f/sscanf() do not mention assignment suppression feature

This commit is contained in:
Christoph M. Becker 2022-05-09 14:49:30 +02:00
parent 46048f1cb2
commit 4225e50bc3
No known key found for this signature in database
GPG key ID: D66C9593118BCCB6
4 changed files with 47 additions and 42 deletions

View file

@ -3410,6 +3410,44 @@ local: {
</varlistentry>
'>
<!ENTITY strings.scanf.parameter.format '
<varlistentry xmlns="http://docbook.org/ns/docbook">
<term><parameter>format</parameter></term>
<listitem>
<para>
The interpreted format for <parameter>string</parameter>, which is
described in the documentation for <function>sprintf</function> with
following differences:
<simplelist>
<member>
Function is not locale-aware.
</member>
<member>
<literal>F</literal>, <literal>g</literal>, <literal>G</literal> and
<literal>b</literal> are not supported.
</member>
<member>
<literal>D</literal> stands for decimal number.
</member>
<member>
<literal>i</literal> stands for integer with base detection.
</member>
<member>
<literal>n</literal> stands for number of characters processed so far.
</member>
<member>
<literal>s</literal> stops reading at any whitespace character.
</member>
<member>
<literal>*</literal> instead of <literal>argnum$</literal> suppresses
the assignment of this conversion specification.
</member>
</simplelist>
</para>
</listitem>
</varlistentry>
'>
<!ENTITY strings.parameter.needle.non-string '
<para xmlns="http://docbook.org/ns/docbook">
Prior to PHP 8.0.0, if <parameter>needle</parameter> is not a string, it is converted

View file

@ -18,12 +18,11 @@
The function <function>fscanf</function> is similar to
<function>sscanf</function>, but it takes its input from a file
associated with <parameter>stream</parameter> and interprets the
input according to the specified <parameter>format</parameter>, which is
described in the documentation for <function>sprintf</function>.
input according to the specified <parameter>format</parameter>.
</para>
<para>
Any whitespace in the format string matches any whitespace in the input
stream. This means that even a tab <literal>\t</literal> in the format
stream. This means that even a tab (<literal>\t</literal>) in the format
string can match a single space character in the input stream.
</para>
<para>
@ -41,7 +40,7 @@
&fs.file.pointer;
</listitem>
</varlistentry>
&strings.parameter.format;
&strings.scanf.parameter.format;
<varlistentry>
<term><parameter>vars</parameter></term>
<listitem>

View file

@ -14,12 +14,11 @@
<methodparam rep="repeat"><type>mixed</type><parameter role="reference">vars</parameter></methodparam>
</methodsynopsis>
<para>
Reads a line from the file and interprets it according to the specified <parameter>format</parameter>, which is
described in the documentation for <function>sprintf</function>.
Reads a line from the file and interprets it according to the specified <parameter>format</parameter>.
</para>
<para>
Any whitespace in the <parameter>format</parameter> string matches any whitespace in the line from the file.
This means that even a tab <literal>\t</literal> in the format string can match a single space character in the input stream.
This means that even a tab (<literal>\t</literal>) in the format string can match a single space character in the input stream.
</para>
</refsect1>
@ -27,7 +26,7 @@
&reftitle.parameters;
<para>
<variablelist>
&strings.parameter.format;
&strings.scanf.parameter.format;
<varlistentry>
<term><parameter>vars</parameter></term>
<listitem>

View file

@ -18,12 +18,11 @@
The function <function>sscanf</function> is the input analog of
<function>printf</function>. <function>sscanf</function> reads
from the string <parameter>string</parameter> and interprets it
according to the specified <parameter>format</parameter>, which is
described in the documentation for <function>sprintf</function>.
according to the specified <parameter>format</parameter>.
</para>
<para>
Any whitespace in the format string matches any whitespace in the input
string. This means that even a tab \t in the format string can match a
string. This means that even a tab (<literal>\t</literal>) in the format string can match a
single space character in the input string.
</para>
</refsect1>
@ -40,37 +39,7 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>format</parameter></term>
<listitem>
<para>
The interpreted format for <parameter>string</parameter>, which is
described in the documentation for <function>sprintf</function> with
following differences:
<simplelist>
<member>
Function is not locale-aware.
</member>
<member>
<literal>F</literal>, <literal>g</literal>, <literal>G</literal> and
<literal>b</literal> are not supported.
</member>
<member>
<literal>D</literal> stands for decimal number.
</member>
<member>
<literal>i</literal> stands for integer with base detection.
</member>
<member>
<literal>n</literal> stands for number of characters processed so far.
</member>
<member>
<literal>s</literal> stops reading at any whitespace character.
</member>
</simplelist>
</para>
</listitem>
</varlistentry>
&strings.scanf.parameter.format;
<varlistentry>
<term><parameter>vars</parameter></term>
<listitem>