Skip to content

Commit 14bdb01

Browse files
authored
Fix failing 32-bit mbstring tests (#13069)
1 parent ddbc74c commit 14bdb01

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

ext/mbstring/tests/euc_tw_encoding.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ mbstring
55
--SKIPIF--
66
<?php
77
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
8+
if (PHP_INT_SIZE == 4 && !extension_loaded("ctype")) die("skip needs ctype extension on 32-bit");
89
?>
910
--FILE--
1011
<?php

ext/mbstring/tests/gb18030_2022_encoding.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ mbstring
55
--SKIPIF--
66
<?php
77
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
8+
if (PHP_INT_SIZE == 4 && !extension_loaded("ctype")) die("skip needs ctype extension on 32-bit");
89
?>
910
--FILE--
1011
<?php
@@ -211,7 +212,7 @@ function readGB18030_2022_ConversionTable($path, &$from, &$to, $utf32 = false) {
211212
// We may be on a 32-bit machine and testing a text encoding with 4-byte codes
212213
// (which can't be represented in a PHP integer)
213214
$char = "";
214-
for ($i = 2; $i < strlen($line); $i += 2) {
215+
for ($i = strpos($line, "\t") + 1; $i < strlen($line); $i += 2) {
215216
$substr = substr($line, $i, 2);
216217
if (ctype_xdigit($substr))
217218
$char .= chr(hexdec($substr));

0 commit comments

Comments
 (0)