function MapInterface::replaceIf
Replaces the entry for the specified key only if currently mapped to the specified value.
This performs a strict type check on the value.
Parameters
K $key The key to remove from the map.:
T $oldValue The value to match.:
T $newValue The value to use as a replacement.:
Return value
bool true if the value was replaced.
1 method overrides MapInterface::replaceIf()
- AbstractMap::replaceIf in vendor/
ramsey/ collection/ src/ Map/ AbstractMap.php - Replaces the entry for the specified key only if currently mapped to the specified value.
File
-
vendor/
ramsey/ collection/ src/ Map/ MapInterface.php, line 141
Class
- MapInterface
- An object that maps keys to values.
Namespace
Ramsey\Collection\MapCode
public function replaceIf(int|string $key, mixed $oldValue, mixed $newValue) : bool;