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 six most used PHP frameworks:
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.
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 six 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|
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.