We use WDDX_serialize and WDDX_unserialize functions, but these are not supported anymore from PHP 7.4 onwards. So we tried the source code of the WDDX part of Pear on a PHP 7.4 based server, but we son't want to install the whole PEAR package to include in our product.
https://pear.php.net/package/XML_Parser2
https://pear.php.net/package/XML_Wddx
When I tried to deserialize, I stumbled upon a class initialization by reference... Ugh...
$t = &new XML_Wddx;
Obviously, PHP 7.4 does not accept that so I remove the ampersand.
I used XML_Parser2 (because XML_Parser is superdeded by it) and XML_wddx, downloaded the source code and unzipped the classes with the test code. It appeared that XML_wddx uses the old XML_Parser which references I replaced by references to XML_Parser2.
But the next problem is more severe: I could not find the function XML_Parser() anywhere in both classes. The call to $t->XML_Parser() is done from deserialize function.
static function deserialize($data)
{
if (function_exists('wddx_deserialize')) {
return wddx_deserialize($data);
}
//!! Constructor by reference ???
//$t = &new XML_Wddx;
$t = new XML_Wddx;
//!! This function DOES NOT EXIST in XML_Parser and XML_wddx, so PHP says BOOM !
$t->XML_Parser();
$t->parseString($data);
return $t->result['data'];
}
Does anybody know how I can fix this ?