mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
#64371 fix alphabetical ordering of specifiers, add table for extra points concerning co-ercion
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@331922 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
c6c82628fa
commit
85cdaa2e89
1 changed files with 47 additions and 4 deletions
|
@ -117,10 +117,6 @@
|
|||
<literal>E</literal> - like <literal>%e</literal> but uses
|
||||
uppercase letter (e.g. 1.2E+2).
|
||||
</member>
|
||||
<member>
|
||||
<literal>u</literal> - the argument is treated as an
|
||||
integer, and presented as an unsigned decimal number.
|
||||
</member>
|
||||
<member>
|
||||
<literal>f</literal> - the argument is treated as a
|
||||
float, and presented as a floating-point number (locale aware).
|
||||
|
@ -146,6 +142,10 @@
|
|||
<literal>s</literal> - the argument is treated as and
|
||||
presented as a string.
|
||||
</member>
|
||||
<member>
|
||||
<literal>u</literal> - the argument is treated as an
|
||||
integer, and presented as an unsigned decimal number.
|
||||
</member>
|
||||
<member>
|
||||
<literal>x</literal> - the argument is treated as an integer
|
||||
and presented as a hexadecimal number (with lowercase
|
||||
|
@ -161,6 +161,49 @@
|
|||
</listitem>
|
||||
</orderedlist>
|
||||
</para>
|
||||
<para>
|
||||
Variables will be co-erced to a suitable type for the specifier:
|
||||
<table xml:id="sprintf.coercion">
|
||||
<title>Type Handling</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Type</entry>
|
||||
<entry>Specifiers</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><literal>string</literal></entry>
|
||||
<entry><literal>s</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>long</literal></entry>
|
||||
<entry>
|
||||
<literal>d</literal>,
|
||||
<literal>u</literal>,
|
||||
<literal>c</literal>,
|
||||
<literal>o</literal>,
|
||||
<literal>x</literal>,
|
||||
<literal>X</literal>,
|
||||
<literal>b</literal>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>double</literal></entry>
|
||||
<entry>
|
||||
<literal>g</literal>,
|
||||
<literal>G</literal>,
|
||||
<literal>e</literal>,
|
||||
<literal>E</literal>,
|
||||
<literal>f</literal>,
|
||||
<literal>F</literal>
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
<para>
|
||||
The format string supports argument numbering/swapping. Here is an
|
||||
example:
|
||||
|
|
Loading…
Reference in a new issue