Can you compare PHP to Java? If so, what would be the differences between PHP and Java?

Showing Answers 1 - 6 of 6 Answers

msdwivedi

  • Dec 28th, 2007
 

Answer: PHP vs JAVA

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.

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.

Java is used for n tier development. i.e is client on other server, business logic on other server and database on other server. Doing this if link fail for one client other client can access whereas in PHP if one server fail all server fails.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions