0

as part of the eway API here: https://eway.io/api-v3/?php#errors

they have this code (in PHP).

$apiKey = '60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR';
$apiPassword = 'API-P4ss';
$apiEndpoint = \Eway\Rapid\Client::MODE_SANDBOX; // Use \Eway\Rapid\Client::MODE_PRODUCTION when you go live
$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

what is the backslash characters all about? I've never seen them in PHP like this before. It seems to be a way to interact with classes. But I can't find anywhere to learn about this way of doing so. Can someone explain what it's about or point to resources that can? (Ideally not just technical jargon websites please).

Why not use a more known way of class interaction in their API documentation?

  • 1
    Does this answer your question? [What does a \ (backslash) do in PHP (5.3+)?](https://stackoverflow.com/questions/4790020/what-does-a-backslash-do-in-php-5-3). They're namespace separators. Pretty standard. I wouldn't say they weren't known about, if you work with classes, particularly from 3rd party packages, you'll come across it a lot, and the syntax has been around for a good few years now. – ADyson Jul 08 '21 at 12:50
  • "Why not use a more known way of class interaction in their API documentation?" - that's something you should ask whoever wrote that documentation – Nico Haase Jul 08 '21 at 13:09

0 Answers0