There is a recommendation on https://phptherightway.com/pages/The-Basics.html using backslash for global functions. Take a look at this code:
<?php
namespace myspace;
class MyClass
{
public $myvar = 'test';
public function myfunction()
{
$withoutBackslash = json_encode($this->myvar);
$withBackslash = \json_encode($this->myvar);
return [$withBackslash, $withoutBackslash];
}
}
How is better with or without backslash? I never used them before should I change my code in either direction (removing or adding)?