[DOC-CVS] [doc-en] master: Update set.xml Specify the correct return type and values, CS (#5215)
[email protected] (Mikhail Alferov via GitHub) Tue, 21 Apr 2026 00:30:54 +0000
| Newsgroups | php.doc.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: Mikhail Alferov (mmalferov)
Committer: GitHub (web-flow)
Pusher: kamil-tekiela
Date: 2026-04-21T01:30:51+01:00
Commit: https://github.com/php/doc-en/commit/7ac16ce2e1d9a65f4f10a92f3161d95c9e27f053
Raw diff: https://github.com/php/doc-en/commit/7ac16ce2e1d9a65f4f10a92f3161d95c9e27f053.diff
Update set.xml Specify the correct return type and values, CS (#5215)
Changed paths:
M reference/quickhash/quickhashinthash/set.xml
Diff:
diff --git a/reference/quickhash/quickhashinthash/set.xml b/reference/quickhash/quickhashinthash/set.xml
index 499bc85e5455..8cad6bd2aa90 100644
--- a/reference/quickhash/quickhashinthash/set.xml
+++ b/reference/quickhash/quickhashinthash/set.xml
@@ -10,7 +10,7 @@
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
- <modifier>public</modifier> <type>bool</type><methodname>QuickHashIntHash::set</methodname>
+ <modifier>public</modifier> <type>int</type><methodname>QuickHashIntHash::set</methodname>
<methodparam><type>int</type><parameter>key</parameter></methodparam>
<methodparam><type>int</type><parameter>value</parameter></methodparam>
</methodsynopsis>
@@ -49,7 +49,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
- 2 if the entry was found and updated, 1 if the entry was newly added or 0
+ 2 if the entry was newly added, 1 if the entry was found and updated, or 0
if there was an error.
</simpara>
</refsect1>
@@ -61,17 +61,17 @@
<programlisting role="php">
<![CDATA[
<?php
-$hash = new QuickHashIntHash( 1024 );
+
+$hash = new QuickHashIntHash(1024);
echo "Set->Add\n";
-var_dump( $hash->get( 46692 ) );
-var_dump( $hash->set( 46692, 16091 ) );
-var_dump( $hash->get( 46692 ) );
+var_dump($hash->get(46692));
+var_dump($hash->set(46692, 16091));
+var_dump($hash->get(46692));
-echo "Set->Update\n";
-var_dump( $hash->set( 46692, 29906 ) );
-var_dump( $hash->get( 46692 ) );
-?>
+echo "\n\nSet->Update\n";
+var_dump($hash->set(46692, 29906));
+var_dump($hash->get(46692));
]]>
</programlisting>
&example.outputs.similar;
@@ -81,6 +81,7 @@ Set->Add
bool(false)
int(2)
int(16091)
+
Set->Update
int(1)
int(29906)