QuickHashIntHash::set

(PECL quickhash >= Unknown)

QuickHashIntHash::setThis method updates an entry in the hash with a new value, or adds a new one if the entry doesn't exist

Beschreibung

public QuickHashIntHash::set(int $key, int $value): bool

This method tries to update an entry with a new value. In case the entry did not yet exist, it will instead add a new entry. It returns whether the entry was added or update. If there are duplicate keys, only the first found element will get an updated value. Use QuickHashIntHash::CHECK_FOR_DUPES during hash creation to prevent duplicate keys from being part of the hash.

Parameter-Liste

key

The key of the entry to add or update.

value

The new value to set the entry with.

Rückgabewerte

2 if the entry was found and updated, 1 if the entry was newly added or 0 if there was an error.

Beispiele

Beispiel #1 QuickHashIntHash::set() example

<?php
$hash 
= new QuickHashIntHash1024 );

echo 
"Set->Add\n";
var_dump$hash->get46692 ) );
var_dump$hash->set4669216091 ) );
var_dump$hash->get46692 ) );

echo 
"Set->Update\n";
var_dump$hash->set4669229906 ) );
var_dump$hash->get46692 ) );
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

bool(false)
int(2)
int(16091)
Set->Update
int(1)
int(29906)

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Was genau bedeutet "Vibe Coding"? Ein tiefgehender Blick für Entwickler

In der Welt der Softwareentwicklung gibt es unzählige Wege, wie man an ein Projekt herangeht. Manche schwören auf strikte Planung, andere auf bewährte Algorithmen und wieder andere lassen sich von etwas ganz anderem leiten: ihrem Gefühl. ...

admin

Autor : admin
Kategorie: Software & Web-Development

PHP cURL-Tutorial: Verwendung von cURL zum Durchführen von HTTP-Anfragen

cURL ist eine leistungsstarke PHP-Erweiterung, die es Ihnen ermöglicht, mit verschiedenen Servern über verschiedene Protokolle wie HTTP, HTTPS, FTP und mehr zu kommunizieren. ...

TheMax

Autor : TheMax
Kategorie: PHP-Tutorials

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

How to Handle Older Console BIOS Files in Web Projects? Need Advice

Hello everyone, I have a question related to managing file handling and download structures in PHP. I am currently working on a small project whe ...

Geschrieben von maxhunter am 08.04.2026 12:06:28
Forum: Fragen/Vorschläge zum Forum
U4GM ARC Raiders Quest Guide: Outstanding Balance

"Outstanding Balance" is one of the newer side quests in ARC Raiders, added with the Flashpoint update and connected to Tian Wen's mission line. T ...

Geschrieben von 1fuhd am 07.04.2026 10:29:34
Forum: Off-Topic Diskussionen
U4GM Diablo 4: Lord of Hatred Launches April 28 with New Classes

Diablo 4's next expansion, Lord of Hatred, is set to launch on April 28, 2026, and early coverage suggests it could be one of the most significant ...

Geschrieben von 1fuhd am 07.04.2026 10:28:45
Forum: Off-Topic Diskussionen
Usertreffen in Berlin am 20.2.2010

Basant Club (https://basantclubdownload.com.pk/) is a popular app in Pakistan to earn money. Download Basantclub and play games and earn a lot of ...

Geschrieben von basantclub am 07.04.2026 08:47:29
Forum: Ankündigungen