facebook / facebook/hhvm

Testcase bug28220.php fails because of bug in mb_strwidth()

Open
#7,643 4 comments 0 reactions 0 assignees View on GitHub
php7 incompatibility probably easy
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

I tested bug28220.php on six different Linux machines (four aarch64 and two x86_64)
with the latest source from git (although I am observing that problem for quite some time already),
but on all machines the test fails with the same error. When I run the test with PHP7 it passes.

The diff is:

```
FAILED: hphp/test/zend/good/ext/mbstring/bug28220.php
001+ 8096
001- 8085
```

I've analysed the issue a bit and could reduce the testcase to the following code:

```
$values = array(
4515,
4516,
4517,
4518,
4519,
4602,
4603,
4604,
4605,
4606,
4607
);
foreach ($values as $v) {
$p=pack('N1', $v);
$sw=mb_strwidth($p, 'UCS-4BE');
echo "$sw\n";
}
```

This prints 1 from HHVM and 2 from PHP7.
The intermediate value $p is equal on both.

The tested machines are:

* aarch64: Ubuntu Xenial
* aarch64: Fedora 25
* aarch64: CentOS 7
* aarch64: OpenSuse LEAP 42.2
* x86_64: CentOS 7
* x86_64: Fedora 25

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.