reference/hash/functions/hash-copy.xml
584a9fb976cccc93109776a904ec1c5ddb2d580f
...
...
@@ -8,8 +8,8 @@
8
8
<refsect1 role="description">
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
-
<type>resource</type><methodname>hash_copy</methodname>
12
-
<methodparam><type>resource</type><parameter>context</parameter></methodparam>
11
+
<type>HashContext</type><methodname>hash_copy</methodname>
12
+
<methodparam><type>HashContext</type><parameter>context</parameter></methodparam>
13
13
</methodsynopsis>
14
14
</refsect1>
15
15

...
...
@@ -32,7 +32,31 @@
32
32
<refsect1 role="returnvalues">
33
33
&reftitle.returnvalues;
34
34
<para>
35
-
Returns a copy of Hashing Context resource.
35
+
Returns a copy of Hashing Context.
36
+
</para>
37
+
</refsect1>
38
+

39
+
<refsect1 role="changelog">
40
+
&reftitle.changelog;
41
+
<para>
42
+
<informaltable>
43
+
<tgroup cols="2">
44
+
<thead>
45
+
<row>
46
+
<entry>&Version;</entry>
47
+
<entry>&Description;</entry>
48
+
</row>
49
+
</thead>
50
+
<tbody>
51
+
<row>
52
+
<entry>7.2.0</entry>
53
+
<entry>
54
+
Accept and return <classname>HashContext</classname> instead of resource.
55
+
</entry>
56
+
</row>
57
+
</tbody>
58
+
</tgroup>
59
+
</informaltable>
36
60
</para>
37
61
</refsect1>
38
62
...
...
@@ -44,15 +68,15 @@
44
68
<programlisting role="php">
45
69
<![CDATA[
46
70
<?php
47
-
$context = hash_init("md5");
48
-
hash_update($context, "data");
71
+
$context = hash_init("sha256");
72
+
hash_update($context, "The quick brown fox ");
49
73

50
74
/* copy context to be able to continue using it */
51
75
$copy_context = hash_copy($context);
52
76

53
77
echo hash_final($context), "\n";
54
78

55
-
hash_update($copy_context, "data");
79
+
hash_update($copy_context, "jumped over the lazy dog.");
56
80
echo hash_final($copy_context), "\n";
57
81
?>
58
82
]]>
...
...
@@ -60,8 +84,8 @@ echo hash_final($copy_context), "\n";
60
84
&example.outputs;
61
85
<screen>
62
86
<![CDATA[
63
-
8d777f385d3dfec8815d20f7496026dc
64
-
511ae0b1c13f95e5f08f1a0dd3da3d93
87
+
b29d66e56ed90cce9b0165c43fedec612b60a071974d8be4513e18580d55b5bd
88
+
68b1282b91de2c054c36629cb8dd447f12f096d3e3c587978dc2248444633483
65
89
]]>
66
90
</screen>
67
91
</example>
68
92