Add Pure builtins for the Regex portion of the HSL.
commit40772b272eb8b8f2f50ae8f2c71aef6d20b33194
authorAlexey Toptygin <alexeyt@fb.com>
Fri, 20 Nov 2020 19:30:49 +0000 (20 11:30 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 20 Nov 2020 19:33:17 +0000 (20 11:33 -0800)
tree2391decb51de7aa706471009872a7f36785b68de
parenta490fd29ff7e9c93525e69e7a61ed82112e88595
Add Pure builtins for the Regex portion of the HSL.

Summary:
This basically moves the workarounds the HSL does around legacy regex functions (suppressing warnings, not mutating preg_last_error) below the line. This means the builtins are Pure (they neither observe nor affect the status of preg_last_error, and they don't produce warnings/errors in the logs), so we can use them to make the Regex portion of the HSL Pure (see the stacked diff for how this would look; I tested the diffs together locally).

After this diff (and the stacked one using it) make it to prod, I intend to make new HSL-friendly versions of our pcre helpers so that the workarounds pushed down into these new builtins can be removed completely.

Reviewed By: fredemmott

Differential Revision: D25072637

fbshipit-source-id: 4dec092660cbca10595ca9e30397d3eaf5fce3ab
hphp/hack/hhi/hsl/ext_regex.hhi
hphp/runtime/ext/hsl/ext_hsl_regex.cpp
hphp/runtime/ext/hsl/ext_hsl_regex.php
hphp/test/slow/ext_hsl/regex_match.php [new file with mode: 0644]
hphp/test/slow/ext_hsl/regex_match.php.expectf [new file with mode: 0644]
hphp/test/slow/ext_hsl/regex_replace.php [new file with mode: 0644]
hphp/test/slow/ext_hsl/regex_replace.php.expectf [new file with mode: 0644]