ava has seen heavy use building enterprise applications, as such, there are a multitude of mature frameworks (Grails, Spring etc..) and experienced developers to make use of. This means that Java can be used for a large variety of usecases, from small applications and single page sites, all the way through to large enterprise applications with lots and lots of data.
PHP has seen use in a large variety of applications as well, it is well known that PHP powers a large amount of applications on the web. Facebook used it in its earlier days, wikipedia, wordpress, among many others. More recently, we’ve seen a lot of nice looking frameworks become available, Laravel for one.
Personally, I’m a big fan of Java and Ruby for web development. They provide the syntactical consistency that I enjoy working with, along with language features and frameworks that make web development a breeze. While PHP isn’t a bad option for web development, whether its better or not is going to come down to the developers you have on hand and the type of application you intend to build.
If you interesting, check out this where compare this two languages between each other I hope it helps