PHP is a server side scripting language that is used to create websites and web applications. Almost all websites nowadays are written in PHP despite its constant criticism. And as every programming language has its pros and cons.
PHP is extremely easy to learn. This language uses open-source libraries and a huge ecosystem that allows developers to learn very fast.
There are a lot of automated tools included in PHP frameworks that make developer’s job much easier. Also debugging allows to see mistakes in the code right on the website and can be hidden from users.
Because PHP community is global and huge, most problems already have ready solutions available for free. This language is growing and changing very fast, that allows developers to create additional libraries and components to help the others.
While writing in PHP, developers use ready-made and proven components that make the final product more secure.
Because PHP is that easy to code, market is full of junior-level self-taught developers. Also, there is a shortage of senior-level developers because there is not much room for skill development.
Despite solutions being widely available, most of the time they are too general and require changes.
PHP is constantly changing and in the long run requires continual adjustments to make sure everything is working correctly.
While creating websites, developers use available frameworks and it makes the website dependent on it. If the framework changes, the website could crash.
But the biggest con is the perception of the language. Because of its availability and the popularity of platforms like WordPress that uses templates to create websites, PHP is associated with low skilled developers and is seen as a language for school kids.
But despite all cons PHP is still the most used language and has the biggest resources including open-source libraries and programming community. And if you need a simple and flexible website, PHP is a way to go.