[self::class, 'replaceDigits'], ], 'item-123'); } $callback = self::mapValue(...); $callback(1); } private static function replaceDigits(array $matches): string { return '[' . $matches[0] . ']'; } }