In our earlier article, we clashed two web development platforms, PHP and Python, in an attempt to find out who is the ultimate winner. As it turned out, both of them can become your go-to platform depending on a range of external factors. For example, your experience and presence of shared environments. The competitors keep up with each other in most of the comparison criteria like community support, debugging, and frameworks.
Today, we’ll dig deeper into the framework topic and get to know what to look for in popular PHP frameworks.
What is a PHP framework?
A PHP framework is a platform for creating web apps. It helps to streamline the development process providing the basic structure for app building.
A PHP framework contains a set of libraries, classes, and elements of design pattern realization on which software engineers code.
Why use a PHP framework?
Employing a framework allows developers to focus on creating the actual website application instead of spending infinite time on writing repetitive code. Other advantages include:
- Increased speed of development due to the reuse of code across projects.
- More stable applications. A framework ensures proper database interaction with code on the presentation layer.
- Security. The frameworks are open-source, so any security issue is quickly spotted and fixed by community members.
- Easy maintenance. Coding with PHP frameworks doesn’t differ from doing it in Core PHP. So any PHP developer can fix or debug something in your application.
However, you should keep in mind the disadvantages of using a PHP web framework.
- Slower execution. PHP libraries and classes add complexity and overhead. If you are running a quick script and API with limited functionality, a simple PHP script might be a better choice.
- Learning. It will take time to understand the design patterns behind PHP frameworks if you want to keep your app structured. So if your project is small, it will be reasonable to use the libraries you are familiar with.
- Too general for specific problems. A framework encompasses a range of solutions for recurring requirements of developers. You will solve your specific problem but at the same time get functionalities you don’t need and will have to remove them.
That is why it’s important to choose the PHP framework that fits your app’s needs.
Overview of the Best PHP Frameworks in 2020
We are going to compare the most used PHP frameworks:
…and share some facts about four more frameworks that worth to be considered:
Let’s first view how the technologies have trended over time in Stack Overflow and Google. According to Stack Overflow, Laravel is way ahead of its peers with around 1.6% of questions by 2020. Symfony and CodeIgniter follow the leader, with around 0.2% of questions.
If we compare the top three PHP frameworks in Google Trends for the past 12 months, we’ll see that Laravel outperforms the rest of the gang as well. By the way, you may get more useful information about it, diving into our Laravel Tutorial.
The numbers in the picture represent search interest relative to the highest point on the chart for the given time worldwide. A value of 100 is the peak popularity for the term. Laravel has scored 93, Symfony – 18, and Codeigniter – 14.
That’s how other frameworks perform: YII2 has scored 73, CakePHP – 57, Zend – 37, and YII – 36.
The tables below represent more parameters to compare the most popular PHP frameworks, such as release date, popularity, PHP version required, and speed.
|PHP version required
|New BSD License
|New BSD License
We don’t recommend to go by this criterion alone. However, popular frameworks have a wider community, hence more information and help for developers
|Downloads (from Packagist)
The following table covers the essential features to look at while choosing a PHP framework for your project.
Speed determines how swift your web application will be. Object-relational mapping (ORM) are the components that help you to transform your database access in a more object-oriented manner. Code generation creates files and default content automatically. Edge Side Includes (ESI) allows to cache the whole page and update only those parts that have changed. Extensive cache storage will cover the most advanced cash needs. Multiple databases will fit more data and provide better security for it.
|Speed (Rest API)
|3.2 ms (slowest)
|ELOQUENT ORM (active record)
Propel (active record)
Access Objects (DAO),
Active Record (AR)
|YII CLI, GII (Web based)
include tag only
|File System, Database, Memcached, APC,
Redis, Xcache, WinCache, Memory (Arrays)
|Memcache, APC File, APC, Memcache, Redis
APC, Memcached, XCache
We’ll round up our PHP framework comparison with the final table demonstrating the general situation on the job market. We’ve consulted two biggest job-listing search engines: Indeed and Monster. As you can see, both search engines give the same top three: Laravel, Symfony, and Zend.
|Number of jobs
|Number of jobs
Additional Frameworks: Less Popular but Still Worth It
Phalcon is a new open-source framework that is becoming more and more popular among developers. Nowadays it considers one of the fastest frameworks. You may compare it with other popular frameworks on the official Phalcon blog.
This PHP framework was developed by Andres Gutierrez and his collaborators and released in 2012. It was originally written in C and C++. The current version is 4.0.3.
Phalcon actually combines PHP and C language. Its tutorial provides an overall view of the Phalcon framework and how to use it.
It’s better to initially have knowledge of HTML, CSS, and PHP as well as the basic understanding of the MVC framework before starting to learn the Phalcon tutorial. The experience of working with traditional frameworks like Laravel or Codeigniter would be an additional benefit.
What are the reasons to use Phalcon?
- It is easy to install and appropriate for creating flexibly configurable apps.
- Its functionality includes asset management, increased execution speed, universal autoloader, strong security and caching.
- It optimizes performance thanks to effective memory utilization that makes Phalcon proper for creating blazing fast websites.
Swoft is a PHP high-performance framework that has many chances to become the best choice for PHP. This microservices coroutine framework looks appropriate for building web systems, APIs, middleware, and basic services.
Swoft is based on Swoole native Coroutine. It can be a Go, built-in coroutine web server and common coroutine client and is resident in memory, independent of traditional PHP-FPM.
What are the reasons to choose Swoft?
- It comes with a resident memory and a set of other Swoole features.
- You get Mysql/Redis/RPC connection pool.
- You may use AOP for all objects managed by the framework container. It will allow you to control the behavior of instance objects without changing the inside of the instance.
- The RPC service is divided into RPC Server and RPC Client. Swoft provides an advanced way to use RPC services.
- It provides a range of rapid build microservice governance components for small and medium-sized businesses (for example, service bucks, service registration and discovery, service throttling).
Lumen is a new project created by the Laravel creator, Taylor Otwell. This is a kind of micro-framework that is a smaller and faster version of a full web app framework. It is primarily built to deliver microservices and blazing fast APIs.You may learn more about in in the official tutorial.
What is it for?
You may need Lumen for projects and components that can benefit from the power of Laravel but can afford to sacrifice some flexibility and configurability in exchange for the advanced speed. Lumen is targeted at microservices – separated components with bounded contexts. That is why in a microservice architecture you might have several small Lumen apps.
Learn more about the difference between Laravel vs Lumen here.
Slim is another micro framework that will assist if you need to create an API. Actually, Slim is often compared with Lumen. It also helps developers quickly create simple but powerful web applications and APIs.
Key advantages of using Slim
Slim is rather simple to learn. PHP developers use Slim to develop RESTful APIs and web services. Among the core features, they highlight URL routing, session, and cookie encryption, client-side HTTP caching, and many more.
It is a good option for a small web app that doesn’t necessarily require a full-stack PHP framework. Besides, its handy documentation and professional maintenance make Slim friendly and high-demanded.
Some More Interesting Facts…
We’ve also compared all these PHP frameworks considering parameters from Ahrefs.com:
- We’ve checked Domain Rating that demonstrates the relative “backlink popularity” of the target website compared to all other websites. It is based on the number of websites linking to the domain’s URLs and their backlink profile strength.
- We’ve also checked Ref Domains that shows how many unique referring domains link to a target in total.
Click on screenshots to enlarge images:
On a final note
PHP frameworks are a great way for a novice developer to gain vast experience in creating web apps. Their code is well-tested, you get to know all the best practices and get support from the community.
Even if you are an expert PHP developer and don’t usually use frameworks, they can still be a helping hand in projects with tight deadlines. Which framework to choose depends on the specific requirements of the project.