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.
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.
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:
However, you should keep in mind the disadvantages of using a PHP web framework.
That is why it’s important to choose the PHP framework that fits your app’s needs.
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||5.6.4||5.6.0||5.6||5.4||5.6||5.3.7|
|License||MiT license||MiT license||New BSD License||New BSD License||MiT license||MiT 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
|GitHub stars||56.8K||22.4K||5.7K||4.9K/ 13K||8.1K||17.8K|
|Downloads (from Packagist)||79M+||46.2M+||5M+||2.1M+||4.9M+||610K+|
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)||5.5 ms||2.2 ms||3.9 ms||3.2 ms (slowest)||5.8 ms||no information|
|ORM||ELOQUENT ORM (active record)||Doctrine 2,
Propel (active record)
Access Objects (DAO),
Active Record (AR)
|Code generation||CLI||CLI||no information||YII CLI, GII (Web based)||CLI||no information|
include tag only
|no information||no information||no information||no information|
|Cache storage||File System, Database, Memcached, APC,
Redis, Xcache, WinCache, Memory (Arrays)
|Memcache, APC File, APC, Memcache, Redis||File,
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||829||398||175||35||22||60|
|Number of jobs||93||47||24||7||9||11|
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.
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.
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.
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.
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.
We’ve also compared all these PHP frameworks considering parameters from Ahrefs.com:
Click on screenshots to enlarge images:
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.