ID: 38577 Updated by: [EMAIL PROTECTED] -Summary: Changing internal character encoding affects function overloading Reported By: php at diptyque dot net Status: Open -Bug Type: mbstring related +Bug Type: Apache related Operating System: FreeBSD 4.4 PHP Version: 4.4.4 New Comment:
Reclassified as Apache-related issue. Previous Comments: ------------------------------------------------------------------------ [2006-08-25 13:32:22] php at diptyque dot net I forgot to mention that mbstring.func_overload is enabled on a per-vhost basis for some other web sites I'm hosting on this platform. ------------------------------------------------------------------------ [2006-08-24 16:20:24] php at diptyque dot net Agreed but I'm not making things up, you know. Something is obviously wrong on my Apache 1.3.34 setup. Could this be a conflict with some extension or Apache module? Of course, no opcode cache is running. Any tip welcome. This weird behavior has been plaguing me for 2 months now and rebuilding PHP doesn't seem to help. I wrote a second test case which demonstrates that function overloading is effectively taking place sporadically while running under apache SAPI -- strlen() may accept the optional encoding argument (!?) as shown in the script output below. http://www.diptyque.net/bugs/mbinfo2.php http://www.diptyque.net/bugs/mbinfo2.phps ; source code =begin [diptyque] % GET http://www.diptyque.net/bugs/mbinfo2.php <pre>int(72208) string(10) "ISO-8859-1" string(10) "ISO-8859-1" string(1) "0" string(19) "Méthodes de codage" int(19) -- bool(true) string(5) "UTF-8" string(10) "ISO-8859-1" string(1) "0" string(19) "Méthodes de codage" int(18) int(19) -- bool(true) string(10) "ISO-8859-1" string(10) "ISO-8859-1" string(1) "0" string(19) "Méthodes de codage" int(19) int(18) </pre> =end If I do run the same script through PHP CLI or FastCGI, I get the following expected warnings: PHP Warning: Wrong parameter count for strlen() in /path/to/htdocs/bugs/mbinfo2.php on line 17 PHP Warning: Wrong parameter count for strlen() in /path/to/htdocs/bugs/mbinfo2.php on line 25 ------------------------------------------------------------------------ [2006-08-24 15:15:31] [EMAIL PROTECTED] Please try with minimal configuration (like ./configure --enable-mbstring) and PHP CLI. If you're still able to reproduce it, you're likely to be the only person who can help you, since I really doubt anyone else can do it. ------------------------------------------------------------------------ [2006-08-24 15:04:03] php at diptyque dot net I moved mbstring function overload initial setting (6) from my php.ini to specific virtual hosts configuration sections but to no avail. It would seem that some Apache processes get it right while others get it wrong (!) This is quite weird -- for example, process #58902 returns int(18) while #58914 returns int(19). [diptyque] % GET http://localhost/bugs/mbinfo2.php <pre>int(58902) string(10) "ISO-8859-1" string(10) "ISO-8859-1" string(1) "0" string(19) "Méthodes de codage" int(19) -- bool(true) string(5) "UTF-8" string(10) "ISO-8859-1" string(1) "0" string(19) "Méthodes de codage" int(18) -- bool(true) string(10) "ISO-8859-1" string(10) "ISO-8859-1" string(1) "0" string(19) "Méthodes de codage" int(19) </pre> [diptyque] % GET http://localhost/bugs/mbinfo2.php <pre>int(58914) string(10) "ISO-8859-1" string(10) "ISO-8859-1" string(1) "0" string(19) "Méthodes de codage" int(19) -- bool(true) string(5) "UTF-8" string(10) "ISO-8859-1" string(1) "0" string(19) "Méthodes de codage" int(19) -- bool(true) string(10) "ISO-8859-1" string(10) "ISO-8859-1" string(1) "0" string(19) "Méthodes de codage" int(19) </pre> ------------------------------------------------------------------------ [2006-08-24 12:41:06] [EMAIL PROTECTED] Right, int(19) is what I get on Linux and FreeBSD 5.4. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/38577 -- Edit this bug report at http://bugs.php.net/?id=38577&edit=1