reference/math/functions/abs.xml
19e8122137a1d42ed60f17fe2c0c2b69b0b2d16b
...
...
@@ -8,11 +8,11 @@
8
8
<refsect1 role="description">
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
-
<type>number</type><methodname>abs</methodname>
12
-
<methodparam><type>mixed</type><parameter>number</parameter></methodparam>
13
-
</methodsynopsis>
11
+
<type class="union"><type>int</type><type>float</type></type><methodname>abs</methodname>
12
+
<methodparam><type class="union"><type>int</type><type>float</type></type><parameter>num</parameter></methodparam>
13
+
</methodsynopsis>
14
14
<para>
15
-
Returns the absolute value of <parameter>number</parameter>.
15
+
Returns the absolute value of <parameter>num</parameter>.
16
16
</para>
17
17
</refsect1>
18
18
<refsect1 role="parameters">
...
...
@@ -20,7 +20,7 @@
20
20
<para>
21
21
<variablelist>
22
22
<varlistentry>
23
-
<term><parameter>number</parameter></term>
23
+
<term><parameter>num</parameter></term>
24
24
<listitem>
25
25
<para>
26
26
The numeric value to process
...
...
@@ -33,13 +33,37 @@
33
33
<refsect1 role="returnvalues">
34
34
&reftitle.returnvalues;
35
35
<para>
36
-
The absolute value of <parameter>number</parameter>. If the
37
-
argument <parameter>number</parameter> is
36
+
The absolute value of <parameter>num</parameter>. If the
37
+
argument <parameter>num</parameter> is
38
38
of type <type>float</type>, the return type is also <type>float</type>,
39
-
otherwise it is <type>integer</type> (as <type>float</type> usually has a
40
-
bigger value range than <type>integer</type>).
39
+
otherwise it is <type>int</type> (as <type>float</type> usually has a
40
+
bigger value range than <type>int</type>).
41
41
</para>
42
42
</refsect1>
43
+

44
+
<refsect1 role="changelog">
45
+
&reftitle.changelog;
46
+
<informaltable>
47
+
<tgroup cols="2">
48
+
<thead>
49
+
<row>
50
+
<entry>&Version;</entry>
51
+
<entry>&Description;</entry>
52
+
</row>
53
+
</thead>
54
+
<tbody>
55
+
<row>
56
+
<entry>8.0.0</entry>
57
+
<entry>
58
+
<parameter>num</parameter> no longer accepts internal objects which support
59
+
numeric conversion.
60
+
</entry>
61
+
</row>
62
+
</tbody>
63
+
</tgroup>
64
+
</informaltable>
65
+
</refsect1>
66
+

43
67
<refsect1 role="examples">
44
68
&reftitle.examples;
45
69
<para>
...
...
@@ -48,12 +72,20 @@
48
72
<programlisting role="php">
49
73
<![CDATA[
50
74
<?php
51
-
$abs = abs(-4.2); // $abs = 4.2; (double/float)
52
-
$abs2 = abs(5); // $abs2 = 5; (integer)
53
-
$abs3 = abs(-5); // $abs3 = 5; (integer)
75
+
var_dump(abs(-4.2));
76
+
var_dump(abs(5));
77
+
var_dump(abs(-5));
54
78
?>
55
79
]]>
56
80
</programlisting>
81
+
&example.outputs;
82
+
<screen>
83
+
<![CDATA[
84
+
float(4.2)
85
+
int(5)
86
+
int(5)
87
+
]]>
88
+
</screen>
57
89
</example>
58
90
</para>
59
91
</refsect1>
...
...
@@ -69,7 +101,6 @@ $abs3 = abs(-5); // $abs3 = 5; (integer)
69
101
</refsect1>
70
102

71
103
</refentry>
72
-

73
104
<!-- Keep this comment at the end of the file
74
105
Local variables:
75
106
mode: sgml
76
107