Skip to content

Commit

Permalink
Merge pull request #31 from GrahamCampbell/patch-1
Browse files Browse the repository at this point in the history
Fix determining the last preg error
  • Loading branch information
freekmurze authored Oct 18, 2018
2 parents e636f0e + 4a2ae66 commit 9a3761f
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 9a3761f

Please sign in to comment.