Skip to content

mb_convert_kana does not work on HK combination in PHP8.2.26 #17141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cjayalmontecm opened this issue Dec 13, 2024 · 2 comments
Closed

mb_convert_kana does not work on HK combination in PHP8.2.26 #17141

cjayalmontecm opened this issue Dec 13, 2024 · 2 comments

Comments

@cjayalmontecm
Copy link

cjayalmontecm commented Dec 13, 2024

Description

The code below works fine on older version(PHP 8.1.13, 8.0.30, 7.4.33), but returns Fatal error: Uncaught ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'H' and 'K' flags in PHP 8.2.26.

The following code:

<?php
$valueStr = "カタカナ ロマンチ 123";
$valueStr = mb_convert_kana($valueStr, 'rnaKVH', 'UTF-8');
echo $valueStr;

Resulted in this output:

// for PHP 8.1.13, 8.0.30, 7.4.33
カタカナ ロマンチ 123

// for PHP 8.2.26
Fatal error: Uncaught ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'H' and 'K' flag

But I expected this output instead:

// for PHP 8.1.13, 8.0.30, 7.4.33
カタカナ ロマンチ 123

// for PHP 8.2.26
カタカナ ロマンチ 123

Online Sandbox Result

image

PHP Version

PHP 8.2.26

Operating System

AlmaLinux8

@SakiTakamachi
Copy link
Member

@cjayalmontecm

See the changelog.
https://www.php.net/manual/en/function.mb-convert-kana.php

This is correct since H and K are flags for different operating modes.

@SakiTakamachi SakiTakamachi closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2024
@cjayalmontecm
Copy link
Author

@cjayalmontecm

See the changelog. https://www.php.net/manual/en/function.mb-convert-kana.php

This is correct since H and K are flags for different operating modes.

Hello @SakiTakamachi, I just saw this also #10174 (comment) ..

Thank you.

@cjayalmontecm cjayalmontecm changed the title mb_convert_kana is broken in PHP8.2.26 mb_convert_kana does not work on HK combination in PHP8.2.26 Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants