Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

Commit

Permalink
Revert "Temp fix for regex_match offset capture issue"
Browse files Browse the repository at this point in the history
This reverts commit c1aa8dd.

patched in OSS HHVM 3.29
  • Loading branch information
fredemmott committed Nov 14, 2018
1 parent bf34484 commit cc326ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/regex/private.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ function regex_match<T as Regex\Match>(
if ($status === 1) {
$match_out = darray[];
foreach ($match as $key => $value) {
// TODO(T35726135) remove when HHVM fix is released.
$match_out[$key] = $value is string ? $value : $value[0];
$match_out[$key] = $value[0];
}
$offset_out = $match[0][1];
/* HH_FIXME[4110] Native function won't have this problem */
Expand Down
4 changes: 2 additions & 2 deletions tests/regex/RegexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,13 @@ public static function provideEveryMatch(
darray[0 => 't1', 1 => '1'],
darray[0 => 'e2', 1 => '2'],
darray[0 => 's3', 1 => '3'],
darray[0 => 't', 1 => ''],
darray[0 => 't'],
]),
tuple('t1e2s3t', re"/[a-z](?P<digit>\d)?/", 0, vec[
darray[0 => 't1', 'digit' => '1', 1 => '1'],
darray[0 => 'e2', 'digit' => '2', 1 => '2'],
darray[0 => 's3', 'digit' => '3', 1 => '3'],
darray[0 => 't', 'digit' => '', 1 => ''],
darray[0 => 't'],
]),
tuple('test', re"/a/", 0, vec[]),
tuple('t1e2s3t', re"/[a-z]/", 3, vec[
Expand Down

0 comments on commit cc326ef

Please sign in to comment.