Bug #77025 [NEW]: mb_strpos throws Unknown encoding or conversion error

From: Date: Tue, 16 Oct 2018 22:01:56 +0000
Subject: Bug #77025 [NEW]: mb_strpos throws Unknown encoding or conversion error
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217598@lists.php.net to get a copy of this message
From:             vs-php-bugs at schukai dot com
Operating system: debian/stretch
PHP version:      7.3.0RC3
Package:          mbstring related
Bug Type:         Bug
Bug description:mb_strpos throws Unknown encoding or conversion error

Description:
------------
the following code works as expected

php7.2 -r "echo \mb_stripos('Hello', 'e', 0, '8bit');"
> 1

in 7.3, however, a error is thrown

php7.3 -r "echo \mb_strpos('Hello', 'e', 0, '8bit');"
> php error

alternatively, mb_stripos does not write any output

php7.3 -r "echo \mb_stripos('Hello', 'e', 0, '8bit');"
> empty result

the following code works with iso-8859-1

php7.3 -r "echo \mb_stripos('Hello', 'e', 0, 'iso-8859-1');"


php7.3 -r "print_r(mb_list_encodings());" contains 8bit and iso-8859-1

Array
(
    [0] => pass
    [1] => auto
    [2] => wchar
    [3] => byte2be
    [4] => byte2le
    [5] => byte4be
    [6] => byte4le
    [7] => BASE64
    [8] => UUENCODE
    [9] => HTML-ENTITIES
    [10] => Quoted-Printable
    [11] => 7bit
    [12] => 8bit
    [13] => UCS-4
    [14] => UCS-4BE

7.2/php.ini and 7.3/php.ini are identical


PHP-Version

PHP 7.3.0RC3 (cli) (built: Oct 15 2018 12:05:08) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.0RC3, Copyright (c) 1999-2018, by Zend
Technologies
    with Xdebug v2.7.0beta1, Copyright (c) 2002-2018, by Derick Rethans

Test script:
---------------
echo \mb_strpos('Hello', 'e', 0, '8bit');

Expected result:
----------------
1

Actual result:
--------------
PHP Warning:  mb_strpos(): Unknown encoding or conversion error in
Command line code on line 1
PHP Stack trace:
PHP   1. {main}() Command line code:0
PHP   2. mb_strpos() Command line code:1

Warning: mb_strpos(): Unknown encoding or conversion error in Command
line code on line 1

Call Stack:
    0.0008     406848   1. {main}() Command line code:0
    0.0008     406848   2. mb_strpos() Command line code:1


-- 
Edit bug report at https://bugs.php.net/bug.php?id=77025&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=77025&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=77025&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=77025&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=77025&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=77025&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=77025&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=77025&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=77025&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=77025&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=77025&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=77025&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=77025&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=77025&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77025&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=77025&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=77025&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=77025&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77025&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=77025&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=77025&r=mysqlcfg



Thread (6 messages)

« previous php.bugs (#217598) next »