Skip to content

Commit 4371af3

Browse files
committed
Fix test portability
1 parent ee76a5a commit 4371af3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ext/iconv/tests/bug76249.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ Bug #76249 (stream filter convert.iconv leads to infinite loop on invalid sequen
77
$fh = fopen('php://memory', 'rw');
88
fwrite($fh, "abc");
99
rewind($fh);
10-
stream_filter_append($fh, 'convert.iconv.ucs-2/utf8//IGNORE', STREAM_FILTER_READ, []);
10+
if (false === @stream_filter_append($fh, 'convert.iconv.ucs-2/utf8//IGNORE', STREAM_FILTER_READ, [])) {
11+
stream_filter_append($fh, 'convert.iconv.ucs-2/utf-8//IGNORE', STREAM_FILTER_READ, []);
12+
}
1113
$a = stream_get_contents($fh);
1214
var_dump(strlen($a));
1315
?>
1416
DONE
1517
--EXPECTF--
16-
Warning: stream_get_contents(): iconv stream filter ("ucs-2"=>"utf8//IGNORE"): invalid multibyte sequence in %sbug76249.php on line %d
18+
Warning: stream_get_contents(): iconv stream filter ("ucs-2"=>"utf%A8//IGNORE"): invalid multibyte sequence in %sbug76249.php on line %d
1719
int(3)
1820
DONE

0 commit comments

Comments
 (0)