1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix failing 32-bit mbstring tests (#13069)

This commit is contained in:
Niels Dossche
2024-01-04 08:30:17 +01:00
committed by GitHub
parent ddbc74c419
commit 14bdb01f8c
2 changed files with 3 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ mbstring
--SKIPIF-- --SKIPIF--
<?php <?php
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
if (PHP_INT_SIZE == 4 && !extension_loaded("ctype")) die("skip needs ctype extension on 32-bit");
?> ?>
--FILE-- --FILE--
<?php <?php

View File

@@ -5,6 +5,7 @@ mbstring
--SKIPIF-- --SKIPIF--
<?php <?php
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
if (PHP_INT_SIZE == 4 && !extension_loaded("ctype")) die("skip needs ctype extension on 32-bit");
?> ?>
--FILE-- --FILE--
<?php <?php
@@ -211,7 +212,7 @@ function readGB18030_2022_ConversionTable($path, &$from, &$to, $utf32 = false) {
// We may be on a 32-bit machine and testing a text encoding with 4-byte codes // We may be on a 32-bit machine and testing a text encoding with 4-byte codes
// (which can't be represented in a PHP integer) // (which can't be represented in a PHP integer)
$char = ""; $char = "";
for ($i = 2; $i < strlen($line); $i += 2) { for ($i = strpos($line, "\t") + 1; $i < strlen($line); $i += 2) {
$substr = substr($line, $i, 2); $substr = substr($line, $i, 2);
if (ctype_xdigit($substr)) if (ctype_xdigit($substr))
$char .= chr(hexdec($substr)); $char .= chr(hexdec($substr));