Contributed by
Nicolas Grekas
in #21353.

The ClassLoader component was released on April 2012, when Composer was just a few months old and developing PHP applications was pretty different than today. Class autoloading is the mechanism used by PHP to load the classes referenced by your code and which haven't been required or included yet.

Symfony provides three autoloaders via the ClassLoader component: two of them load classes that follow PSR-0 and PSR-4 standards and the other one uses a static map of classes and files. In addition, Symfony provides special wrappers for those loaders to add caching and debugging features.

Although this component was useful to improve the application performance when using PHP 5, in the new PHP 7 era this is no longer true. That's why we've decided to deprecate the entire ClassLoader component.

If you use PHP 7, you can already test this change in your Symfony applications by removing the following line in your front controllers (both web/app.php and web/app_dev.php):

// app_dev.php
// ...
$kernel = new AppKernel('dev', true);
// $kernel->loadClassCache();   <-- comment/remove this line
// ...

// app.php
// ...
$kernel = new AppKernel('prod', false);
// $kernel->loadClassCache();   <-- comment/remove this line
// ...

You shouldn't notice any performance impact in your application, as long as you use PHP 7 and the class loader provided by Composer. Finally, you should read the class loading optimization article recently published by Composer to know more about the options that will make your application faster.