Fix an incompatible code (with some PHP versions) in the API