reference/math/functions/hexdec.xml
761d72245071f89a626903c9bcdc6aaff1252d54
761d72245071f89a626903c9bcdc6aaff1252d54
...
...
@@ -8,7 +8,7 @@
8
8
<refsect1 role="description">
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
-
<type>number</type><methodname>hexdec</methodname>
11
+
<type class="union"><type>int</type><type>float</type></type><methodname>hexdec</methodname>
12
12
<methodparam><type>string</type><parameter>hex_string</parameter></methodparam>
13
13
</methodsynopsis>
14
14
<para>
...
...
@@ -20,6 +20,7 @@
20
20
<para>
21
21
<function>hexdec</function> will ignore any non-hexadecimal
22
22
characters it encounters.
23
+
As of PHP 7.4.0 supplying any invalid characters is deprecated.
23
24
</para>
24
25
</refsect1>
25
26
<refsect1 role="parameters">
...
...
@@ -43,31 +44,30 @@
43
44
The decimal representation of <parameter>hex_string</parameter>
44
45
</para>
45
46
</refsect1>
47
+
46
48
<refsect1 role="changelog">
47
49
&reftitle.changelog;
48
-
<para>
49
-
<informaltable>
50
-
<tgroup cols="2">
51
-
<thead>
52
-
<row>
53
-
<entry>&Version;</entry>
54
-
<entry>&Description;</entry>
55
-
</row>
56
-
</thead>
57
-
<tbody>
58
-
<row>
59
-
<entry>4.1.0</entry>
60
-
<entry>
61
-
The function can now convert values that are too big for
62
-
the platforms <type>integer</type> type, it will return
63
-
the value as <type>float</type> instead in that case.
64
-
</entry>
65
-
</row>
66
-
</tbody>
67
-
</tgroup>
68
-
</informaltable>
69
-
</para>
50
+
<informaltable>
51
+
<tgroup cols="2">
52
+
<thead>
53
+
<row>
54
+
<entry>&Version;</entry>
55
+
<entry>&Description;</entry>
56
+
</row>
57
+
</thead>
58
+
<tbody>
59
+
<row>
60
+
<entry>7.4.0</entry>
61
+
<entry>
62
+
Passing invalid characters will now generate a deprecation notice.
63
+
The result will still be computed as if the invalid characters did not exist.
64
+
</entry>
65
+
</row>
66
+
</tbody>
67
+
</tgroup>
68
+
</informaltable>
70
69
</refsect1>
70
+
71
71
<refsect1 role="examples">
72
72
&reftitle.examples;
73
73
<para>
...
...
@@ -76,18 +76,37 @@
76
76
<programlisting role="php">
77
77
<![CDATA[
78
78
<?php
79
-
var_dump(hexdec("See"));
80
-
var_dump(hexdec("ee"));
81
-
// both print "int(238)"
82
-
79
+
var_dump(hexdec("ee")); // prints "int(238)"
80
+
var_dump(hexdec("a0")); // prints "int(160)"
81
+
?>
82
+
]]>
83
+
</programlisting>
84
+
</example>
85
+
</para>
86
+
<para>
87
+
<example>
88
+
<title><function>hexdec</function> with Invalid Characters</title>
89
+
<programlisting role="php">
90
+
<![CDATA[
91
+
<?php
92
+
var_dump(hexdec("See")); // print "int(238)"
83
93
var_dump(hexdec("that")); // print "int(10)"
84
-
var_dump(hexdec("a0")); // print "int(160)"
85
94
?>
86
95
]]>
87
96
</programlisting>
88
97
</example>
89
98
</para>
90
99
</refsect1>
100
+
<refsect1 role="notes">
101
+
&reftitle.notes;
102
+
<note>
103
+
<para>
104
+
The function can convert numbers that are too large to fit into the platforms
105
+
<type>int</type> type, larger values are returned as <type>float</type> in
106
+
that case.
107
+
</para>
108
+
</note>
109
+
</refsect1>
91
110
<refsect1 role="seealso">
92
111
&reftitle.seealso;
93
112
<para>
94
113