Java and PHP are both popular programming languages.
Java is designed to run in a variety of environments, where PHP is mainly designed and used in server-side web programming.
Many say that Java is better for large applications. And many PHP programmers start to hate PHP.
But, I would say, that is totally non-sense.
At the very root, it is the problem of design skill.
Think of it. To use Java in production, one has to endure quiet some training, so they will follow some defined approach to accomplish the tasks. But PHP is so easy to learn, novices start building websites quickly, and sadly it ends in chaos, because these novices has totally no notion of system architectures.
PHP provide speedy startups of new functions. Try and error can be in low cost, as prices of software programs are often measured in how many man-hours are cast into their building. So PHP really saves start-ups.
Later, as the program goes bigger, as long as the development team keep modules independent of each other or loosely coupled, there will be no problems.
So PHP is totally no worse than Java, at least as server-side programming language.
The reason that people claim that they prefer Java is mainly due to training business. Java is difficult to learn, so providing training makes good money. That’s it!