Both languages serve their purposes. PHP is almost always quicker to prototype with. The same would likely be said for Perl vs. Java or Python vs. Java. Or in other words whole interpreted vs. compiled and static vs. dynamic.
Java and PHP have different markets in mind. Sun points Java at everything, while PHP is most likely a web oriented tool.
<!--[if !supportEmptyParas]-->
In PHP each page is a script, executed in its own memory environment. That means PHP is great for dynamic web site, whereas server Java is for server-centric applications, which is a different class of problem.
For a "pure" website, development in PHP is way faster, and performance and scalability is easier to achieve than in Java.
For heavy applications (multi-user workflow, XA transactions, distributed objects. as soon as you really need an application server, and not just the HTTP layer), the "application" notion is needed and Java fits here. You are not more forced to test code in the server environment in PHP than in Java.
The cost for Java scalability is high (clustered app-servers with high price tags) whereas PHP scalability is cheap.