diff --git a/src/Html2Text.php b/src/Html2Text.php
index 1763cb4..af7e9ae 100644
--- a/src/Html2Text.php
+++ b/src/Html2Text.php
@@ -39,7 +39,7 @@ public static function convert(string $html, $options = []): string {
// check all options are valid
foreach ($options as $key => $value) {
- if (!in_array($key, array_keys(static::defaultOptions()))) {
+ if (!array_key_exists($key, static::defaultOptions())) {
throw new \InvalidArgumentException("Unknown html2text option '$key'. Valid options are " . implode(',', static::defaultOptions()));
}
}