So I had to do a comparison between the Java language and PHP for college... and I thought I'd put it online as an article :-) Here it goes!
In comparison to PHP, the J2EE language is far more maintainable in terms of updating an application or website. It is heavily object oriented, whereas OOP in PHP is rather new, since mostly, it is scripting. Java also has a better linear performance. And thus, it beats PHP on performance benchmarks as well.
In polls and according to most programmers, J2EE is better for enterprise applications. One of the reasons being, that Java is a more powerful language, since the developer/programmer can call on many other Java API's to perform complex tasks. To do this in PHP, one has to look for existing plug-ins and download them. Therefore, although PHP may be easier to learn, J2EE is easier to use.
Scalability is always important when deciding a language for a particular application. J2EE is mostly used for large scale applications, while PHP is mostly used for smaller applications.
In terms of framework, it only Java who has it. PHP offers only some tools for the programmer to work with. To conclude with, Java's documentation and support is far more robust than that found for PHP