Here is an example of an XML API call with an unspecified protocol
version.
$request = '<server><get><stat/></get></server>';
$stats = pm_ApiRpc::getService()->call($request)->server->get->result->stat->objects;
The PHP library allows to achieve the same goal using this code:
$stats = $client->server()->getStatistics()->objects;