diff --git a/src/regex/private.php b/src/regex/private.php index 8764a95b..e10a3dea 100644 --- a/src/regex/private.php +++ b/src/regex/private.php @@ -47,8 +47,7 @@ function 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 */ diff --git a/tests/regex/RegexTest.php b/tests/regex/RegexTest.php index a2987d41..71922550 100644 --- a/tests/regex/RegexTest.php +++ b/tests/regex/RegexTest.php @@ -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\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[