I been working on PHP framework for many years that I maintain for our internel closed source project.
While I updating this and keeping to coding standards with PHP 7 I notice that alot of developers use \ in there classes and namespaces that are called within the code.
for example
class ClassName extends ParentClass implements
\ArrayAccess,
\Countable,
\Serializable
{
// constants, properties, methods
}
or for example calling the class within functions of the classes
public function featured()
{
// Check for request forgeries
\Session::checkToken() or jexit(\Text::_('JINVALID_TOKEN'));
$user = \Factory::getUser();
$ids = $this->input->get('cid', [], 'array');
$values = ['featured' => 1, 'unfeatured' => 0];
$task = $this->getTask();
$value = \ArrayHelper::getValue($values, $task, 0, 'int');
}
why is \ used and what is it purpose since it can work without \ as well.
as I cant see any information online what the use of the \ is for in classes and namespaces.