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

Commit cc326ef

Browse files
committed
Revert "Temp fix for regex_match offset capture issue"
This reverts commit c1aa8dd. patched in OSS HHVM 3.29
1 parent bf34484 commit cc326ef

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/regex/private.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ function regex_match<T as Regex\Match>(
4747
if ($status === 1) {
4848
$match_out = darray[];
4949
foreach ($match as $key => $value) {
50-
// TODO(T35726135) remove when HHVM fix is released.
51-
$match_out[$key] = $value is string ? $value : $value[0];
50+
$match_out[$key] = $value[0];
5251
}
5352
$offset_out = $match[0][1];
5453
/* HH_FIXME[4110] Native function won't have this problem */

tests/regex/RegexTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,13 @@ public static function provideEveryMatch(
184184
darray[0 => 't1', 1 => '1'],
185185
darray[0 => 'e2', 1 => '2'],
186186
darray[0 => 's3', 1 => '3'],
187-
darray[0 => 't', 1 => ''],
187+
darray[0 => 't'],
188188
]),
189189
tuple('t1e2s3t', re"/[a-z](?P<digit>\d)?/", 0, vec[
190190
darray[0 => 't1', 'digit' => '1', 1 => '1'],
191191
darray[0 => 'e2', 'digit' => '2', 1 => '2'],
192192
darray[0 => 's3', 'digit' => '3', 1 => '3'],
193-
darray[0 => 't', 'digit' => '', 1 => ''],
193+
darray[0 => 't'],
194194
]),
195195
tuple('test', re"/a/", 0, vec[]),
196196
tuple('t1e2s3t', re"/[a-z]/", 3, vec[

0 commit comments

Comments
 (0)