I'm trying to make the following work:
function flosoftdedicated_api_init() {
require_once 'resources/vendor/autoload.php';
use \Ovh\Common\Ovh;
....
$ovh = new Ovh($config);
return $ovh;
}
function flosoftdedicated_ClientArea($params) {
global $ovh;
$ovh = flosoftdedicated_api_init();
....
}
but I get the error:
Parse error: syntax error, unexpected T_USE in ..../flosoftdedicated.php on line 35 Line 35 being the use statement.
Is it not possible to use a namespace in a function? Do I need to assign the same namespace?