ID:               38577
 User updated by:  php at diptyque dot net
 Reported By:      php at diptyque dot net
-Status:           Feedback
+Status:           Open
 Bug Type:         mbstring related
 Operating System: FreeBSD 4.4
 PHP Version:      4.4.4
 New Comment:

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


Previous Comments:
------------------------------------------------------------------------

[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.

------------------------------------------------------------------------

[2006-08-24 12:33:17] php at diptyque dot net

Oops, my mistake. You should swap Expected and Actual 
results. Actual result is int(18) !? Expected result is 
int(19).

------------------------------------------------------------------------

[2006-08-24 12:28:30] php at diptyque dot net

Granted I could not reproduce either this bug using a WAMP 
setup but did you follow the hyperlink I gave on my 
FreeBSD-based server, where you can consistently replicate 
this bug on each GET request?

------------------------------------------------------------------------

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

Reply via email to