DEV Community

Cover image for Top 5 PHP frameworks: Laravel vs Yii vs Zend vs Phalcon vs Symfony, their good and bad sides
mkdev.me for mkdev

Posted on • Edited on • Originally published at mkdev.me

Top 5 PHP frameworks: Laravel vs Yii vs Zend vs Phalcon vs Symfony, their good and bad sides

РНР frameworks have a wide variety of functions and ecosystems suitable for zillions of tasks. With them you can create more sophisticated, safe and user-friendly apps and websites in little time.

Why do developers actually use PHP frameworks?

Developers pick them as they speed up the development process, are safe out of the box and scalable.

It’s not an easy task to find a framework that is suitable for you and will work as expected. Below you can find top 5 the most popular frameworks.

Laravel

Good sides

  • Best IoC (Inversion of control)
  • Convenient migration system
  • Embedded module testing
  • Templating engine Blade
  • Flexible routing
  • Lots of ways to build REST API
  • Laravel is developing instantly
  • Plenty of docs on any topic
  • Laravel is very popular all over the world
  • Built-in debug console with call stack function
  • RBAC
  • ACL plug-ins

Bad sides

  • You need to work with Laravel facades if you want to have access to all the features, IDEs do not recognize methods and properties in some classes and show the warning message
  • Learning curve is steeper than the Yii2’s one
  • No embedded interface generation

Learning curve: you need to be OOP and databases savvy.

Average salary of a Laravel developer: $89.774/year or more

Phalcon

Good sides

  • High performance
  • Lots of features
  • Suitable for Highload environments
  • Situated in RAM
  • Doesn’t require many file operations
  • Doesn’t consume many resources
  • You can use your favorite database library and its elements
  • Databases are handled through ORM which leads to higher performance
  • All processes are fast, as the framework has direct access to the PHP internal structures

Bad sides

  • Its source code is written in C
  • Not really popular yet
  • It is an extension (which means that you might be not able to run the app on a shared hosting)
  • There are many people who still do not have a clue about Phalcon

Learning curve: smooth. You need to be OOP savvy, understand design patterns and have practical experience in some projects.

Average salary of a Phalcon developer: $50.000/year or more

Symfony

Good sides

  • Is pretty similar to Yii. Symfony documentation insists that it’s not an MVC framework
  • Native support of Codeception allows writing functional and acceptance tests
  • Has the YAML component, which is a huge advantage for any framework
  • Such projects as Drupal and PhpBB are built using some Symfony2 components
  • Large community of developers
  • Lots of ready-to-use module sets called bundles
  • Detailed and clear documentation
  • Pretty high core performance
  • Loose coupling

Bad sides

  • Symfony uses much-feared ORM (Propel and Doctrine) and is resource-intensive
  • Steep learning curve
  • Too many entities of different kinds
  • Contains annotation syntax

Learning curve: steep. You need to be OOP savvy, understand design patterns and have practical experience with some other frameworks.

Average salary of a Symfony developer: $85.000/year or more

Zend framework

Good sides

  • Class inheritance
  • Object-oriented
  • Has ready-to-use solutions for many tasks
  • You can integrate whatever you’d like to with anything at all
  • Internationalization tools
  • Support of the developers community
  • Documentation of high quality

Bad sides

  • Not really suitable for rapid development
  • Slower than some other frameworks (but still, fast enough for 90% of websites, the database is always the bottleneck.)
  • Requires a lot of time to master
  • Resource-intensive

Learning curve: steep. You need to be OOP savvy, understand design patterns and have practical experience with some other frameworks.

Average salary of a Zend developer: $87.000/year or more

Yii2 framework

Good sides

  • Web-based code generator
  • Intuitive MVC architecture. You may enjoy learning it from scratch
  • Utilizes common problem-solving patterns, which makes code less messy
  • Makes it easier to maintain code that uses common architecture and methods
  • Great community of developers, ready to help with the framework, generalized problems and new features
  • Saves time spent on mundane tasks such as form validation and safety check
  • Easy to configure for better performance
  • Not resource-intensive
  • Different caching options
  • Third party libraries and classes can be easily integrated
  • Safety tools of good quality
  • Behaviors, helpers, an ability to extend basic functionality etc.
  • Suitable for projects of any scale and complexity

Bad sides

  • Not really flexible routing
  • Frontend and backend libraries are heavily entangled

Learning curve: smooth. You need to be OOP and databases savvy and that’ll be enough.

Average salary of a Yii2 developer: $75.000/year or more


This is an mkdev article written by Ruslan Kuptsov. You can hire Ruslan to be your personal PHP mentor.

Top comments (6)

Collapse
 
szymach profile image
Piotr Szymaszek

So are ORMs good or bad? First you write "Databases are handled through ORM which leads to higher performance", but then "Symfony uses much-feared ORM (Propel and Doctrine) and is resource-intensive"?

Collapse
 
nme84 profile image
Jeroen van den Broek

Worse than that, he makes no mention of Laravel's deep involvement with Eloquent, an arguably less elegant ORM solution in which the data defines the model rather than the model defining the data. It's really easy to end up with code that cannot use code completion because your editor has no way of knowing what fields exist in your database.

Most of the cons listed for Symfony (the framework I'm most familiar with) are very weak as well. Yes, Symfony supports annotations but they are always just one of several options. There is little to no need to use them if for whatever reason you don't want to. And what the hell does "Too many entities of different kinds" even mean? Entities in Symfony's context are part of your ORM so assuming those aren't what he's talking about it is a poor choice of words. And in this case I don't see what the problem is. Too many features? Too many options? How is an abundance of either of those a problem as long as things are documented well (which they are)?

Collapse
 
buphmin profile image
buphmin

So ORM's have pros and cons always. They can help with maintainability, structure, and coding in a more object oriented fashion. They also take longer to run, use more ram and generally create more boilerplate.

Collapse
 
szymach profile image
Piotr Szymaszek

Yes, but the author contradicts himself without giving a reason for it. You cannot state the same thing as a pro and then as a con without a word of explanation for it.

Collapse
 
mateuschmitz profile image
Mateus Schmitz

Good post!

Something cool:
When I was working in a Brazilian hosting company, I suggested offering Phalcon in a shared environment. We did, and we were the first one in Brazil.

It was me that put the KingHost's logo in phalconphp.com/pt/hosting

I have been using Phalcon for the last 3/4 years, and it's my favorite framework. I think its performance, lower overhead and learning curve are excellent points. The fact that being developed in Zephir is something to be considered.

Collapse
 
buphmin profile image
buphmin

Neat article. I have found it pretty hard to get everything right when looking at frameworks since there is just so much to them.