PHP is a free and open-source scripting language. It is a multi-purpose programming language that is most widely used for web development. Originally, the language’s name stood for “Personal Home Page.” Later on, it was shortened to “PHP: Hypertext Preprocessor,” which created a recursive acronym and Java is a high-level level, general purpose, class-based programming language that is multi-platform, object-oriented, and has a network-centric approach. It has a specialty in the WORA (Write Once Run Anywhere) approach. Used as a computing platform by Sun Microsystem, Java was later acquired by Oracle Corporation. Both languages have different features. You can refer below resource to check the features of both languages.
https://www.interviewbit.com/blog/features-of-java/
https://www.interviewbit.com/blog/features-of-php/