As a fresher, if you are trying to decide between Java and PHP, don’t spend too much time to look for which language is “better”. Both have different use cases and job market is different for each.
PHP will help you work in companies where web development, websites and applications. Choosing PHP will help you land a job in web oriented job roles where you will work and develop web based applications.
Java will enable you to work in backend development, enterprise applications and large software systems. These are your applications that run on Java like installable software, desktop applications etc.
You are essentially deciding the track of your career – web or general applications. You might have also heard things like “PHP is dead” or “PHP is out dated language” or “Java can run everywhere” or “Java can be used in desktop and web” and many things. These are all generic statements which are not entirely true and should not be considered while making your choice.
Java does run everywhere, but in reality not many web sites lately are powered by Java. They are mainly used in backend to power applications.
PHP is indeed very old, but one of the world’s most used Content Management System, WordPress is written in PHP. But you are going to be working only on web based applications.
Look at the opportunity that is presented to you while making the choice. Both are valid options but they will restrict you greatly on whether you will work on web technology or desktop/backend.
