title: Is it better to use ::class rather than hardcoded string?
body: <p>In php7, when retrieving instances from dependency injection containers or service containers, is it better to use <code>::class</code> rather than a hardcoded string? If so, why?</p>
  
  <p>For example, are the following lines preferable:</p>
  
  <pre><code>$diContainer-&gt;get(Namespace\SubNamespace\Class::class);
  $serviceContainer-&gt;get(Namespace\SubNamespace\Class::class);
  </code></pre>
  
  <p>rather than the following:</p>
  
  <pre><code>$diContainer-&gt;get('Namespace\SubNamespace\Class');
  $serviceContainer-&gt;get('Namespace\SubNamespace\Class');
  </code></pre>
  
  <p>I've been using hardcoded strings with the belief that the code will compile quicker since php does not need to interpret the <code>::class</code> keyword. However, I've also seen lots of new php7 code that uses <code>::class</code>.</p>
  
  <p>More broadly, whenever the fully qualified class name is required, is it generally better to use <code>::class</code> rather than the hardcoded string?</p>