As is pretty obvious by my blog, GitHub repos and my job I'm a PHP developer. I'm also pretty adept with JavaScript and SQL. Lately I've been getting back into Java development a little more seriously. This gist is a series of short articles about some of the differences I've noticed between PHP and Java.
To be specific my Java development recently has been web development using Google App Engine. I am intending to create a RESTful API utilizing the language.
The differences discussed are not intended to be an indictment against either language. Some things about PHP I really like, some things about PHP I really dislike. The same goes for Java. Some things PHP is really good for and other things Java is really good for. This is not meant to be a religious war between languages.
I realize that in a way this is comparing apples and oranges. PHP is a dynamic, interpreted (althought yes it is still compiled) scripting language while Java is a static, compiled (although yes it is still interpreted) programming language. We aren't here to discuss just basic differences; we want to look at distinct ways the languages differ that encourages thoughts and insights into why the two languages were designed the way they were.
You might want to look at Go as well. Go is closer to the metal and the web since the whole stack can be Go (the database, server, and app). The main thing PHP devs might miss are more mature ORM's and sorted maps (or in PHP they are called associative arrays).