PHP developers who are using class features in their projects would have to do a lot of circus to load specific class before using them. php __autoload() (would be deprecated in future), spl_autoload_register(), psr-0 & psr-4 standards to autoload them.
The __autoload() or for that matter spl_autoload_register() function (with paths of all classes in it) defined for example in start.php have to be first included in index or whatever the php page is and then do your work with the loaded class object.
In psr-0 & psr-4 we configure composer.json's by setting autoload's psr-0 or psr-4 or classmap path to vendor folder. Do dump-autload, include that single generated autoload.php in your php file and psr-4 convention of "use" "namespace" said to make our life much easier (which is not).
In java, define classes under packages then simply import required class and use it.
My question is, why is php loading of classes is not as simple as java packages & import?
I know that there might be some implementation difficulties if not nearly impossible.
Few thousands of new c code line if not lakhs would definitely not slow the php interpreter to help find class names which are mentioned in import keyword and load that class from the packages as similar to java, instead of these tedious conventions (spl_autoload_register(),psr-0,psr-4) which are suppose to make loading the classes easier.
I have used java in most of my projects. so, I am new to php and the kind of question might be well expected which might appear pretty noob one. Replies are much appreciated. Thanks.