Key Takeaways
- Based on a survey, the most promising PHP frameworks for 2014 are Laravel, Phalcon, and Symfony2, with Yii and CodeIgniter tied for the fourth spot.
- Laravel’s popularity is primarily due to its ease of entry, excellent documentation, large community support, and quick development speed. However, there is a misconception that Laravel is responsible for Composer, which is a package manager independent of the frameworks it’s used with.
- Phalcon’s main advantage is its performance over other frameworks and a rounded up package that includes ORM, template engine, PHQL, and more. However, being written in C, it is difficult to check under the hood.
- Symfony2 is considered the most modular and extensible framework, and the most feature-complete due to containing Doctrine2. However, it’s often criticized for being bloated and slow because of its feature-richness.
Update: If you’d like to take part in the next high-yield survey from SitePoint, please vote for your favorite IDE here. The aim of the survey is to gauge the PHP community, and to find the most popular IDE in use today, by gender, location, skill level, and more.
The end of the year is upon us. Lots has changed in the PHP world in the past 365 days, and the PHP framework scene is more densely populated than ever. Everyone and their dog seems to have an idea of what a good framework should look like, but in the end, do we even know which frameworks actually end up being used in production projects? How many go beyond the stage of thousands of people just doing a demo app in them?
In a small survey we’ve held open for the past week or so (which has also been mentioned in PHP Weekly), we asked these questions to decide which frameworks deserve our attention in 2014 the most. The prerequisite for participation was merely having experience in more than one framework, seeing as it’s pointless to ask someone what their favorite bar was if they’ve only drunk in one place.
Unfortunately, a big percentage of the answers had to be discarded due to people either refusing the notion that WordPress and similar suites aren’t frameworks, or simply due to a blatant disregard of instructions – many responses were written by people who only ever worked in one framework. While their enthusiasm for this framework of choice is noteworthy and admirable, the final result which may end up being skewed by such approaches could hardly be called objective.
Results summary
After discarding the invalid responses, and manually verifying every participant, we were left with the following data:
According to the results, the most promising frameworks for 2014 seem to be:
- Laravel
- Phalcon
- Symfony2
Yii and CodeIgniter seem to be sharing 4th place.
After weeding out the obvious spam, the Laravel results had to be filtered the most, by far. Over half the people who voted for Laravel had zero proof of proficiency, or experience only with Laravel, and had to be discarded – despite this, it still prevailed.
When looking at the answers, on average, the Laravel community seems to mostly favor the ease of entry – virtually no learning curve. Whether that’s good or bad is a discussion for another time, seeing as we ended up in this “PHP is bad” mess mostly due to a horde of newbies considering it an easy to enter market, but the excellent documentation, large scale community support and speed of development definitely work in its favor. Another frequently mentioned advantage seems to be an active and impressively alive IRC channel where help is given instantly.
An interesting misconception seems to be that Laravel is responsible for Composer. Many voters, both discarded and valid ones, mention Composer as the main advantage of Laravel, alongside Eloquent ORM and the Blade template engine, which is downright odd seeing as Composer is a package manager completely oblivious to the framework it’s being used with, if any. For more information, I urge the participants in question to read some of our Composer articles, like this one. Despite all this, having only tried Laravel in demo projects, the results of this survey have piqued my interest enough to build my next production project in it, powered by HHVM.
Phalcon’s main advantage was performance over other frameworks and the fact that the framework is such a rounded up package (ORM, template engine, PHQL and more – all in one – little to no need for third party libs, meaning everything stays in-memory, C-based and super fast). Some of the respondents noted the fact that it’s installed as an extension as an advantage, because the process of installation weeds out the hobbyists from the serious developers, a notion I personally tend to agree with. When mentioning cons, Phalcon’s biggest one was also its biggest advantage – being written in C, it’s nigh impossible to check under the hood.
Symfony2 is touted as the most modular and extensible of the bunch, and the most feature complete, mainly due to containing Doctrine2. Its voters, however, do seem able to admit that it’s quite bloated and slow at times due to this feature-richness.
Interestingly, two ZF1 answers said they’re stuck on said framework because of the work situation – their team or CTO refuses to switch to something more modern.
Noteworthy answers
Among the valid answers, here are some detailed enough to warrant a repost:
navarr says:
Yii’s built in ActiveRecord and migration systems make version control of the database easy and development using objects quick and painless. It takes a small amount of time to learn but become super simple afterwards – becoming worth it’s namesake “Yii” – Chinese for “easy”
@amitgupta says:
I’ve used CodeIgniter for years but eventually came a point where it didn’t offer what I needed. I needed a somewhat full stack framework (so micro frameworks like Slim, Silex were out) with little or no learning curve (just like CI), which had a neat & clean intuitive API, solid code written on proven design patterns, which didn’t bind me in one mindset, which was fast and had good documentation, which allowed TDD without fuss and which had a good community & resources available. Also one which allowed me to take a peek under the hood easily so I can see what goes on where (which ruled Phalcon out since its source is in C). Laravel & Symfony came very close but I eventually went with Laravel as I liked how it did things more.
panique doesn’t use any of the listed ones, and says:
Most frameworks are simply too advanced, making it hard for non-professional developers or frontend people to quickly build good things, so I was always searching for a naked and totally stripped-down PHP barebone application. php-mvc solves this problem and reduces the learning curve to a total time of under 30 minutes while still being very professional and self-explaining.
+Jream says this about Phalcon:
Provides all the core components I need to get going fast, beautiful ORM. It’s feature rich, insanely fast, and has amazing documentation.
Chris Thompson proves that exposure and name mean much in the PHP world by saying this about his choice of ZF2:
I was already familiar with ZF1 from a previous project. ZF2 seemed the most logical one to use for our next project. We didn’t have any experience with or exposure to most of the other frameworks. Ones that we were aware of had less documentation, examples, and online help (stackoverflow) than ZF2.
Peter Nijssen explains:
Been working with CodeIgniter for 4 years. Always suited me well and I wrote some sparks for it. Always has been a nice quick framework to start with. Easy to use. Since CodeIgniter was not on going anymore, while PHP made some major steps, I came in touch with Laravel. Immediately fell in love with it and still love it to this date. A framework which works excellent and is very developer-friendly. In my daily job, we are migrating everything from CodeIgniter to Symfony. In my personal life I would pick Laravel, while in professional life I would pick symfony. Laravel is more developer friendly and makes it a breeze to develop against. Symfony gives me currently more trust in the fact that they have been proven themselves already for years. Of course, both contain their similarities by Laravel who is using Symfony parts.
Thiago Colares chooses TYPO3 Flow:
Architecture-ready for domain driven design. Dependency injection. Uses the Doctrine 2 ORM. Advanced template engine (Fluid). Strong, active, very skilled and helpful community
Rob Keplin says this about Phalcon:
It takes advantage of other popular framework’s features such as event management, an easy to use ORM, all while promoting DI and taking advantage of newer PHP features like native namespaces. Since it is built as an extension, the framework has very little overhead. Not to mention the documentation makes for an easy learning curve. The only drawback is portability and I’m not able to dig through the library code while developing. But I’m really excited to see it grow and become more popular.
… and Sean M adds
Phalcon makes it easy to design modern web application correctly, and makes it hard to design them incorrectly. Using direct injection, it is trivially easy to create software that tests fully end-to-end. An ORM that makes sensible default choices and is hugely extensible and configurable, multiple caching strategies, and built-in DB libraries for tons of helpers to allow for easy horizontal scalability. Add in the huge speed gains and trivial memory usage realized by using a shared-library written in C for all your requests, and you get a stack that is a true pleasure to work with and an absolute workhorse in production.
@DwightConrad about Laravel:
Laravel uses the solid, tested components of the Symfony framework along with other popular packages to provide a modern framework that provides easy conventions, utilises modern programming patterns and makes development a breeze. It is refreshing to see PHP used as a modern programming language with a framework that takes hints from some of the big names outside of the PHP community.
Stanlemon favors Symfony2:
Architecturally I prefer Symfony 2. I think it’s attempt at componentization is admirable and the overall approach of bundles is brilliant. At times it can feel bloated and still at other times I wish it were more opinionated, but all in all it represents the only full stack framework that just lets me get things done the way that I want to. The use of Doctrine 2, Twig and Monolog and a powerful approach to functional testing is only further encouragement to use it.
Editor’s choice
It’s no secret I’m a fan of Phalcon. I’ve used Zend 1 and 2 in large scale enterprise projects for years, and I did my time with CodeIginter. After testing (no commercial experience) all the frameworks in the list, I came to the conclusion that, deep down, they’re all incredibly similar (except for Zend, which just stands out like a sore thumb). It was upon that realization that I redirected all my focus on the performance/robustness ratio instead, and found Phalcon. Phalcon has been sufficiently covered in previous articles – suffice it to say that having such a blazing fast framework pre-loaded in memory does wonders for your cloud bills (whether you use AWS, Azure or any others – the instance hours are delightfully shaved off – more on that in a future article).
The fact that it’s harder to install than the others (and nigh impossible on shared environments) also makes sure the community is a hardcore one, filled to the brim with people who are genuinely interested in it enough to not get bogged down by the basics. This means a tighter-knit group, but far more knowledgeable.
Conclusion
So which framework seems most promising for 2014? Which should you switch to in the new year? Is it worth it? That’s entirely up to you – as always, it depends on your comfort level, the project requirements, and time you have to study new things.
The only wrong choice is constraining yourself to only a single framework. Diversify, experiment, contribute. Step out of your comfort zone and try something new – there’s no other way to grow. Perhaps next year, you’ll vote differently!
I want to personally thank you for participating in the survey, and being our readers. We hope to bring you increasingly more awesome articles in 2014, and look forward to sharing the knowledge of our amazing authors with you. The entire team here at SitePoint wishes you a Happy New Year and jolly holidays! See you over the hump!
Interested in taking your PHP skills to the next level? Learnable memberships come with unlimited access to SitePoint books and courses, covering PHP topics from MySQL to object-oriented programming.
Frequently Asked Questions about PHP Frameworks
What are the key factors to consider when choosing a PHP framework?
When choosing a PHP framework, you should consider several factors. First, consider the size and complexity of your project. Some frameworks are better suited for large, complex projects, while others are ideal for small, simple projects. Second, consider the learning curve. Some frameworks are easier to learn and use than others. Third, consider the community and support. A large, active community can provide valuable help and resources. Lastly, consider the performance and scalability of the framework. It should be able to handle your project’s needs as it grows and evolves.
How does Laravel compare to other PHP frameworks?
Laravel is one of the most popular PHP frameworks due to its elegant syntax, robust features, and vibrant community. It offers a clean and classy approach to coding, making it a favorite among developers. Laravel also comes with its own templating engine called Blade and includes features such as routing, authentication, sessions, caching, and more. However, it may have a steeper learning curve compared to other frameworks.
What are the advantages of using Symfony?
Symfony is a flexible, scalable, and feature-rich PHP framework. It’s known for its reusable PHP components that can be used standalone or within other projects. Symfony also follows the MVC design pattern, supports database engine-independent, and has a vibrant community. It’s ideal for large-scale or complex enterprise level projects. However, it might be overkill for small projects and it has a steep learning curve.
Why should I consider using CodeIgniter?
CodeIgniter is a lightweight and straightforward PHP framework that’s easy to install, making it ideal for beginners. It’s built for developers who need a simple and elegant toolkit to create full-featured web applications. CodeIgniter also offers strong security features, including input and XSS filtering, and supports MVC architecture.
Can you tell me more about the Yii framework?
Yii is a high-performance, component-based PHP framework for developing modern web applications. It’s known for its efficiency and performance optimization, making it ideal for high-traffic websites. Yii also follows the MVC pattern and offers features like DAO/ActiveRecord, caching, authentication and role-based access control, scaffolding, and testing.
What makes Phalcon unique among PHP frameworks?
Phalcon stands out among PHP frameworks because it’s delivered as a C-extension, meaning it’s blazing fast. It’s optimized for high performance and lower resource consumption. Phalcon also offers features like asset management, caching, translation, and security.
How does CakePHP stand out from other PHP frameworks?
CakePHP is a PHP framework that makes building web applications simpler and faster. It provides a robust base for your application, allowing you to focus on the core development. CakePHP follows the MVC pattern and offers features like form validation, SQL injection prevention, CSRF protection, and more.
What is Slim and when should I use it?
Slim is a PHP micro-framework that helps you quickly write simple yet powerful web applications and APIs. It’s minimalistic in design and is excellent for small applications where a full-stack PHP framework would be unnecessary and overwhelming.
Can you tell me more about Zend Framework?
Zend Framework is a robust and stable PHP framework packed with a lot of configuration options. It’s ideal for complex, enterprise-level projects. However, it can be overkill for smaller projects and has a steep learning curve.
What is FuelPHP and what are its advantages?
FuelPHP is a flexible, full-stack PHP framework that supports the MVC pattern and a more advanced version called Hierarchical-Model-View-Controller (HMVC). With its modular and extendable architecture, FuelPHP allows developers to build end-to-end web applications with a lot of autonomy.
Bruno is a blockchain developer and technical educator at the Web3 Foundation, the foundation that's building the next generation of the free people's internet. He runs two newsletters you should subscribe to if you're interested in Web3.0: Dot Leap covers ecosystem and tech development of Web3, and NFT Review covers the evolution of the non-fungible token (digital collectibles) ecosystem inside this emerging new web. His current passion project is RMRK.app, the most advanced NFT system in the world, which allows NFTs to own other NFTs, NFTs to react to emotion, NFTs to be governed democratically, and NFTs to be multiple things at once.