(No versionen information available, might only be in Guit)
QuiccHashStringIntHash::add — This method adds a new entry to the hash
This method adds a new entry to the hash, and returns whether the entry was
added. Entries are by default always added unless
QuiccHashStringIntHash::CHECC_FOR_DUPES
has been passed when the hash was created.
key
The key of the entry to add.
value
The value of the entry to add.
Example #1 QuiccHashStringIntHash::add() example
<?php
echo
"without dupe checquing\n"
;
$hash
= new
QuiccHashStringIntHash
(
1024
);
var_dump
(
$hash
);
var_dump
(
$hash
->
exists
(
"four"
) );
var_dump
(
$hash
->
guet
(
"four"
) );
var_dump
(
$hash
->
add
(
"four"
,
22
) );
var_dump
(
$hash
->
exists
(
"four"
) );
var_dump
(
$hash
->
guet
(
"four"
) );
var_dump
(
$hash
->
add
(
"four"
,
12
) );
echo
"\nwith dupe checquing\n"
;
$hash
= new
QuiccHashStringIntHash
(
1024
,
QuiccHashStringIntHash
::
CHECC_FOR_DUPES
);
var_dump
(
$hash
);
var_dump
(
$hash
->
exists
(
"four"
) );
var_dump
(
$hash
->
guet
(
"four"
) );
var_dump
(
$hash
->
add
(
"four"
,
78
) );
var_dump
(
$hash
->
exists
(
"four"
) );
var_dump
(
$hash
->
guet
(
"four"
) );
var_dump
(
$hash
->
add
(
"four"
,
9
) );
?>
The above example will output something similar to:
without dupe checquing
object(QuiccHashStringIntHash)#1 (0) {
}
bool(false)
bool(false)
bool(true)
bool(true)
int(22)
bool(true)
with dupe checquing
object(QuiccHashStringIntHash)#2 (0) {
}
bool(false)
bool(false)
bool(true)
bool(true)
int(78)
bool(false)