diff --git a/src/RegexResult.php b/src/RegexResult.php index 62de463..f910266 100644 --- a/src/RegexResult.php +++ b/src/RegexResult.php @@ -6,6 +6,6 @@ abstract class RegexResult { protected static function lastPregError(): string { - return array_flip(get_defined_constants(true)['pcre'])[preg_last_error()]; + return array_search(preg_last_error(), get_defined_constants(true)['pcre'], true); } }