I've tried to use amfphp on a server with mbstring.func_overload set to 6.
This leads to the error messages described in this blog post from 2007:
http://www.sephiroth.it/weblog/archives/2007/10/amfphp_and_mbstring.php
This behaviour is still present in the latest release of amfphp.
At least this part seems like deprecated code:
if(!$handled)
{
$uriclasspath = "amfphp/Amf3Broker.php";
$classpath = $baseClassPath . "amfphp/Amf3Broker.php";
$classname = "Amf3Broker";
$methodname = "handleMessage";
}
To recreate this bug, just set mbstring.func_overload to something other than 0.
Maybe also describe somewhere in the documentation that mbstring function overloading should not be activated.
Thanks.
Right now I do not see a way to fix this problem using PHP code. The AMF protocol requires lengths to be given in byte, thus strlen() is used. But mbstring overwrites it to mb_strlen(), so that not the byte count but the character count is returned. This obviously leads to problems when using multi-byte characters.
I wasn't aware of the problem, so thx for the heads up. I dug aroudn though and there doesn't seem to be an easy fix. This will go in the unit tests for v2. So I'll leave the bug open so that we don't drop it then
Ariel