What is a PHP framework and which one should I learn and use?

PHP Tools

Framework is a tool to help you develop applications faster and better. It is a reusable set of libraries and/or classes. They usually define default folder structure of a project.

There are many existing, well established and secure open source frameworks with large communities behind them. Rather than reinventing the wheel many developers use them to built web applications. There is NO best and NO official PHP framework, because different purposes and different projects require different tools and approaches.

Using established existing open source framework is strongly advised when working in a team. Framework can provide developers same set of standards and better interoperability when they build application together.

Which framework should you learn?

Before diving into a PHP framework get yourself familiar with some advanced concepts such as OOP, design patterns, ORM, authentication, MVC (model view controller) etc. For bigger projects usage of popular open source frameworks instead of your custom one or procedural programming is advised.

Before understanding modern open source PHP frameworks check also Composer - a dependency Manager for PHP.

In your career path you will not need to know all of them but you should learn how to use few of the frameworks that are widely used in the industry or are important to you. Organizations and companies are always moving towards modern popular established frameworks so for predicting which framework will get you a job in PHP market today is a task for a prophet or a fortune teller - therefore it is almost impossible. You can check the popularity trends in PHP community and check the most popular ones (according to the stars on GitHub) but don’t get fooled by such comparison charts. Each organization can move towards something else sooner or later.

Learning some complex PHP frameworks can have a steep learning curve.

According to the architecture the framework itself is built upon there are three major types of frameworks we will use to categorize them in this FAQ:

Component frameworks

Component frameworks are built and decoupled into separate components that you can use in your application independently on other components. You can just use some components or all of them. Most of component frameworks can be also a full stack framework (described in the next section) at the same time.

Full stack frameworks

Full stack framework includes everything you need to develop an application in one package. Decoupling of components is mostly not possible.

Micro-frameworks

Micro-framework holds simple core with very lightweight infrastructure of classes and libraries. Main purpose of micro-frameworks is fast building of application and still keep lightning speed of performance with small footprint.

Miscellaneous

  • API Platform - API-first web framework on top of Symfony with JSON-LD, Schema.org and Hydra support.
  • Medoo - PHP Database Framework
  • Zend Expressive - Minimalist PSR-7 middleware framework for PHP.

All the popular and the ones we have encountered in this group are listed above in alphabetical order.

Other resources

GitHub OctocatFound a typo? Something wrong with this content? Just fork and edit it.

Content of this work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license. Code snippets in examples are published under the CC0 1.0 Universal (CC0 1.0). Thanks to all the contributors.