Here's a handy wddx_deserialize clone I wrote a while back. It uses PHP5 SimpleXML and recursion to do pretty much the same task as wddx_deserialize. Hope it comes in handy for someone.
<?php
if (!function_exists('wddx_deserialize'))
{
function wddx_deserialize($xmlpacket)
{
if ($xmlpacket instanceof SimpleXMLElement)
{
if (!empty($xmlpacket->struct))
{
$struct = array();
foreach ($xmlpacket->xpath("struct/var") as $var)
{
if (!empty($var["name"]))
{
$key = (string) $var["name"];
$struct[$key] = wddx_deserialize($var);
}
}
return $struct;
}
else if (!empty($xmlpacket->array))
{
$array = array();
foreach ($xmlpacket->xpath("array/*") as $var)
{
array_push($array, wddx_deserialize($var));
}
return $array;
}
else if (!empty($xmlpacket->string))
{
return (string) $xmlpacket->string;
}
else if (!empty($xmlpacket->number))
{
return (int) $xmlpacket->number;
}
else
{
if (is_numeric((string) $xmlpacket))
{
return (int) $xmlpacket;
}
else
{
return (string) $xmlpacket;
}
}
}
else
{
$sxe = simplexml_load_string($xmlpacket);
$datanode = $sxe->xpath("/wddxPacket[@version='1.0']/data");
return wddx_deserialize($datanode[0]);
}
}
}
?>