|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73441 mb_internal_encoding() never returns
Submitted: 2016-11-02 07:30 UTC Modified: 2016-11-02 19:59 UTC
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: inge at vabekk dot no Assigned:
Status: Not a bug Package: mbstring related
PHP Version: 7.0.12 OS: Ubuntu 16.04
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: inge at vabekk dot no
New email:
PHP Version: OS:


 [2016-11-02 07:30 UTC] inge at vabekk dot no
From manual page:
This function does not return.

Test script:
mb_internal_encoding (UTF-8);

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-02 09:58 UTC]
-Summary: PHP 7.0.8-0ubuntu0.16.04.3 +Summary: mb_internal_encoding() never returns -Type: Documentation Problem +Type: Bug -Package: PHP Language Specification +Package: mbstring related
 [2016-11-02 18:03 UTC]
-Status: Open +Status: Feedback
 [2016-11-02 18:03 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

Your script is not valid PHP code. It will not execute as PHP but instead display "HERE 1 HERE 2!" in your browser.
 [2016-11-02 18:46 UTC] inge at vabekk dot no
-Status: Feedback +Status: Open
 [2016-11-02 18:46 UTC] inge at vabekk dot no
It's easier to describe the output outside of the php statements.
However, I also lost a question mark. So write it this way:

echo "HERE 1\n";
mb_internal_encoding (UTF-8);
echo "HERE 2\n";

The expected result should be evident.
 [2016-11-02 18:47 UTC]
-Status: Open +Status: Feedback
 [2016-11-02 18:53 UTC] inge at vabekk dot no
-Status: Feedback +Status: Open
 [2016-11-02 18:53 UTC] inge at vabekk dot no
The "UTF-8" should be surrounded by quotes - I used a variable and forgot them.
 [2016-11-02 18:54 UTC]
-Status: Open +Status: Feedback
 [2016-11-02 18:54 UTC]
It still works.
 [2016-11-02 19:03 UTC] inge at vabekk dot no
-Status: Feedback +Status: Open
 [2016-11-02 19:03 UTC] inge at vabekk dot no
I run this function alone and get this result:
php erter.php
PHP Fatal error:  Uncaught Error: Call to undefined function mb_internal_encoding() in /Store/inge/bin/erter.php:3
Stack trace:
#0 {main}
  thrown in /Store/inge/bin/erter.php on line 3

There is no return from the function. This is php 7.
 [2016-11-02 19:05 UTC]
-Status: Open +Status: Not a bug
 [2016-11-02 19:05 UTC]
You don't have the mbstring extension installed.

apt-get install php-mbstring
 [2016-11-02 19:27 UTC] inge at vabekk dot no
Hard to find good documentation for this. The function documentation states that it should be valid for php7 - the need for this install should be made more clear. The error did not occur for php5.
 [2016-11-02 19:59 UTC]
It is valid. The problem is that your PHP 7 setup does not have mbstring installed while your PHP 5 setup did. It's a configuration issue when you set up your Ubuntu server.

And in case it wasn't clear enough, the error message is telling you that the function was not defined. Does not exist. Which is because the extension that defined it was not loaded."Call+to+undefined+function+mb_internal_encoding"
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Feb 26 08:01:27 2024 UTC