Both PHP and Java are the web languages which are used for Web Application Development.
Originally, PHP was not supporting OOP [Object Oriented Programming]. But with PHP4 that problem was solved. Moreover, with PHP 5.3 some really great IDEs [Integrated Development Environments] have emerged to support PHP Development and the support for OOP has also improved tremendously. On the other hand, Java has always been uniquely defined by its OOP nature and has always had great IDEs.
Most of new programmers prefer PHP because of its support with both OOP and Procedural Programming and both are easy to learn. Java developers on the other hand are well trained and have to be properly familiar with OOP.
The consistency of PHP is better than Java. Java has little issues with consistency mainly that arrays and primitive types are different things than the objects one can’t create. While in PHP, arrays always get passed by value that is if you are assigning an array to a variable you are actually copying all its content to a new array. Basically PHP has nice arrays as they numerically indexed and associative too at the same time.
Java Web Development is mainly used in large corporations for more complex system development while PHP is mostly used in small scale or medium scale corporations. Today, both languages PHP and Java are on an equal footing as now PHP has a variety of wonderful IDEs to develop in and also supports OOP as effectively as Java. Because of this many large corporations have started adopting for PHP.