php8.5
Home/ Manual/ quickhash / quickhashstringinthash/ QuickHashStringIntHash::get

QuickHashStringIntHash::get

PHP function Edit on GitHub ✎

This method retrieves a value from the hash by its key

Description

QuickHashStringIntHash::get(string $key): mixed

This method retrieves a value from the hash by its key.

Parameters

key

The key of the entry to retrieve.

Return Values

The value if the key exists, or null if the key wasn't part of the hash.

Examples

QuickHashStringIntHash::get() example

php
<?php
$hash = new QuickHashStringIntHash( 8 );
var_dump( $hash->get( "one" ) );

var_dump( $hash->add( "two", 2 ) );
var_dump( $hash->get( "two" ) );
?>

The above example will output something similar to:

output
bool(false)
bool(true)
int(2)

Source: reference/quickhash/quickhashstringinthash/get.xml · from the official PHP manual (php/doc-en)