Docs

hash_equals( string $a, string $b ): bool

Compare two strings in constant time.

Description

This function was added in PHP 5.6.
It can leak the length of a string.

Parameters

$astringrequired
Expected string.
$bstringrequired
Actual string.

Return

bool Whether strings are equal.

Changelog

VersionDescription
1.0.0Introduced.