Skip to content

Commit

Permalink
Fix determining the last preg error
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell authored Oct 18, 2018
1 parent e636f0e commit 4a2ae66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/RegexResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 4a2ae66

Please sign in to comment.