diff --git a/language-snippets.ent b/language-snippets.ent index b0642a8a03..f041b00a38 100644 --- a/language-snippets.ent +++ b/language-snippets.ent @@ -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 diff --git a/reference/filesystem/functions/fscanf.xml b/reference/filesystem/functions/fscanf.xml index 1017a4292a..d32b2a7275 100644 --- a/reference/filesystem/functions/fscanf.xml +++ b/reference/filesystem/functions/fscanf.xml @@ -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> diff --git a/reference/spl/splfileobject/fscanf.xml b/reference/spl/splfileobject/fscanf.xml index 6318d2c2dc..eeb54d9327 100644 --- a/reference/spl/splfileobject/fscanf.xml +++ b/reference/spl/splfileobject/fscanf.xml @@ -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> diff --git a/reference/strings/functions/sscanf.xml b/reference/strings/functions/sscanf.xml index 343e4f1316..40977dca7b 100644 --- a/reference/strings/functions/sscanf.xml +++ b/reference/strings/functions/sscanf.xml @@ -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>