PHP is a backend programming language for making websites. A lot of developers have a love/hate relationship with PHP and many say it's a dead language you shouldn't bother learning.
But PHP has increased in popularity recently with the Laravel framework by Taylor Otwell providing a better structure and more features for PHP projects. Let's dive into the world of PHP and if it's really dead.
What is PHP?
First off, let's go over what PHP actually is. It's a programming language especially created for making websites. PHP is distinctive for it's dollar sign syntax. For instance, variables always start with a $ symbol.
e.g. $name = "Pete"
Whereas with JavaScript, keywords var, let or const are used:
e.g. let name = "Pete"
PHP is a backend language which is embedded within HTML to produce web pages.
Why do people love PHP?
PHP can be an easy programming language for beginners to learn. It can be simple to get a website online and you can use free database options like SQLite. Some beginners also like the fact that you can mix PHP with HTML in one file. This means it can be very accessible for people who are new to web development.
Also, Wordpress, which is a software powering the majority of the world's websites, is written in PHP. So a lot of people get their first taste of using PHP by editing Wordpress websites. PHP is also loosely typed so it is a more forgiving language if you make a mistake.
Why do people hate PHP?
Lots of developers really dislike PHP. This is often based on past versions of the programming language and early experiences of coding with PHP. It can be a very flexible language, which means inexperienced devs can often end up writing "spaghetti code" which is messy and hard to maintain. There is a lot of freedom when you write code with PHP but this can also be a bad thing if it means your code is hard to understand or is badly organised. Python developers may dislike PHP because it does not have indentation.
How has Laravel changed PHP?
Laravel is a framework based on the model/view/controller (MVC) structure (much like Ruby on Rails). The MVC structure is designed so that there is a separation of concerns with your code and it's not all just dumped into one giant PHP file.
Laravel has led to a renaissance in PHP as it comes with lots of features that entrepreneurs like such as Stripe or Paddle billing, authentication, server management, sending emails and lots more. This makes it a lot quicker to build Software as a Service (SaaS) websites.
Laravel raised $57m from Accel in 2024 in a move towards gaining a bigger share of the Enterprise market. This is a good signal for the PHP job market if bigger companies begin to use Laravel more.
Companies that use PHP
• Wordpress
Wordpress is a blogging content management system that is used for roughly 40% of the world's websites. It allows people who don't have coding skills to run content-based websites like blogs. There are approximately 450 million websites around the world that use Wordpress. Underneath the hood, Wordpress is run on PHP.
• Statamic
This is a modern CMS that is built on Laravel.
• DHL
This European postal service uses Laravel for part of its website according to Built With Laravel.
Founders who use PHP
PHP is popular with lots of founders who are put off by the complexity of JavaScript frameworks like NextJS. Whether they use a framework like Laravel or just use plain PHP without frameworks, here are some examples:
• Val makes $300k a year from Thankbox, an online gifting platform, with Laravel
• Phil runs 4dayWeek, a profitable job board for 4 day week jobs with PHP
• Rod runs a directory of job boards, which has made $49k so far, with PHP
• Arvid Kahl, uses Laravel to make his Podscan business
Should I still learn PHP?
A lot of people will tell you not to learn PHP. JavaScript is certainly more popular. But look at it another way, it can be good to learn PHP as there is a big demand for developers with this knowledge.
By learning PHP, you'll stand out in a job market which is swamped with developers who only know JavaScript. Many companies that use Laravel have spoken publicly about the struggle they have in finding good software developers that know PHP.
Another reason to learn PHP is that Laravel has made it a lot easier to start a software business. Laravel has a "batteries included" approach to web development so there are lots of features like logging in and taking payments which are trivial to add with this stack. This means you can build your website quicker and focus on that all important marketing.