laravel VS thinkphp, how to decide?
ThinkPHP vs Laravel The two most popular PHP frameworks in China at the moment, which one is better and which one is worse is the most controversial! As a beginner, I am also very confused, which one is better to learn?
In this article, PHP Chinese Network will take a careful inventory. It is not a boast or a black eye, and it is not convenient to be biased.
First of all, let’s briefly introduce these two most popular PHP frameworks
ThinkPHP
ThinkPHP is written by Chinese people Development is a free, open source, object-oriented, lightweight PHP development framework. Born in early 2006, it is the most used in China. The 20th PHP live class teaching project on the php Chinese website uses ThinkPHP6, which is very suitable for beginners!
Popular version
ThinkPHP5.x: launched in 2015, MVC mode, supports PHP>=5.6
ThinkPHP6.x: newly launched in 2019 , start using Composer to install and update, support PHP>=7.1
Laravel
Popular versions:
Laravel 8.x: Released on September 8, 2020, PHP version >= 7.3Laravel 9.x : Launched on February 8, 2022, only supports PHP 8.0/8.1Who is better?
Let’s first take a look at what netizens say, and finally express the opinions of php Chinese website
The first game: usage popularity (heat)
Netizen evaluation 1: ThinkPHP is used the most in China, and Laravel in the world deserves to be NO.1. In China, TP is most commonly used by small and medium-sized enterprises. Based on TP, they build their own frameworks for their own use and fully control their own destiny. Netizen evaluation 2: The framework itself has no comparison, because the emergence of each architecture represents a demand scenario, or performance, or learning, or scalability, Or the ease of use, if you want to say who has the greater advantage, then I think we can only say that companies using TP have greater advantages, while companies using laravel have greater advantages. Because more people around you use it, your learning cost will be smaller. (I guess you are not selecting framework technology for the project as an architect) Netizen comment 3: Laravel is actually a very bloated thing, while think is a very light one. Something of magnitude. To be honest, I think I prefer it. For a Chinese developer, what could be more comfortable than an all-Chinese document? Netizen evaluation 4: Go and look at the source code As for the trading platform, many website programs are developed based on TP. In addition, PHP developers basically master TP, and it is easy to do secondary development of source code. Netizen evaluation 5: There is no need to get entangled. Although he lacks ability, he stands from God's perspective and overlooks everything; he does not ask for a deeper understanding, but he dares to speak loudly and despise everything. Such people are everywhere, whether PHP is bad or the framework is rubbish... They go around everywhere and like to complain about various languages and technologies, and they take great pleasure in doing so. It's pitiful how many novices were led into the ditch by these nonsense guys. When I was a little bird, I was brainwashed by a so-called teacher's SB. The general idea was that TP is for small projects, laravel is for big projects, etc...I really believed it at that time, It's still too young now that I think about it. You must understand that when a person accepts a new thing, his initial opinions have a great influence, and because you don't know much about it, you can't judge right from wrong. This kind of thing is also invisible and harmful to people. Therefore, in my opinion, problems similar to this can be practiced by yourself, read the documents and write projects, and it is self-evident that you can do three or four other projects. You will never be deceived by knowledge scammers again. , and as time goes by, my understanding becomes deeper and deeper. The down-to-earth experience was really refreshing. If you leave the scene and talk about language and framework, it means nothing. All languages emerge to solve practical problems, and tolerance and in-depth study and research are the right way to go. Otherwise it is nothing.Second round: Ecology
Netizen evaluation 1: Ecologically, Laravel is more powerful than thinkPHP. This is There is no doubt that, especially from 6. strengthen. Netizen evaluation 2: thinkphp is relatively lightweight, has many domestic users, and is relatively easy to get started. The complete Chinese documentation and a large number of Chinese users are very attractive.The third game: Design
Netizen evaluation 1:Judging from the latest version, the two are getting closer and closer, and the technologies and design concepts used are more similar. When comparing technology and design concepts, it is inevitable to fall into the misunderstanding of “who copies whom”.
In contrast, thinkPHP still has a way to go. I personally feel that the current goal of tp is still to refine the framework. Some people who criticize tp use the changes from v3 to v5 to v6 to prove that tp is still in use. Plagiarizing Laravel, I think it is a bit too much. As an open source framework, the technology itself is public. The purpose of open source is also to serve more real-life applications. For new technologies and new design concepts, I think any framework that wants to develop We will work hard to optimize and empower the framework to adapt to new application scenarios.
Netizen evaluation 2:
In terms of the production environment, the thinkphp framework is a domestic product. In terms of design thinking and habits, Chinese people will definitely be given priority. Even if they are not considered, Chinese people will be better. Understanding, a significant feature is that when you look at the documentation of thinkphp, you will always understand it better than laravel. The design of obtaining TP was a bit rough and low from the beginning, but through the evolution of these several versions, we can clearly see its progress. We might as well give it more time to see its future development direction.
Netizen evaluation 3:
It is obvious that laravel's UI polishing is beyond thinkPHP's. It can be seen from their respective official websites and the actual applications of their respective frameworks. Debate
The fourth round: Team
Netizen evaluation 1:
Laravel’s team is obviously stronger than ThinkPHP’s team. Therefore, it has stronger technical and material resources to support its update and commercialization process.
The fifth round: performance
Netizen evaluation 1:
I have used both laravel and ThinkPHP 5 recently. This is because the company has a business line with great concurrency requirements, but is unwilling to pay too high a cost (this refers to the server, the company is not willing to buy expensive servers). When I first started using Laravel, its high concurrency efficiency was really good. Poor, and unwilling to improve server performance, I had no choice but to write another one using ThinkPHP. The conclusion is that the concurrency performance of ThinkPHP 5 on the same configured server is much higher than that of Laravel. Although I have not compared it carefully, I have seen someone compare it before. ThinkPHP is 4-5 times that of Laravel. I think which one is better has a lot to do with the project and business line.
Netizen Comment 2:
The current shortcoming of Laravel is that laravel loads too many files. As a result, the execution speed of each request will be slower. I would say that one of the upcoming updates to PHP 7.4 is the preloading feature. This function is that the framework part of PHP can be started along with PHP's FastCGI process, thus eliminating the need to load a bunch of files each time, resulting in low performance.
Netizen evaluation 3:
tp is lightweight, that is, upgrading the version will be downward incompatible. Laravel is relatively heavyweight, and many functions have been completed. There is no need to reinvent the wheel, and version iterations are also easy. Pretty fast.
Netizen evaluation 4:
The difference is quite big. Laravel’s underlying source code uses more design patterns. Thinkphp is much simpler. Laravel’s life cycle is more complicated. How many times does thinkphp load? After writing a file, the request is distributed to the controller, which is obviously much simpler.
Sixth Bureau: Security
Netizen evaluation 1:
Security TP has been updated, but the update illustrates a problem, indicating that a very serious vulnerability needs to be updated. I don’t know if hackers like to make domestic products, but relatively speaking, the security is still very high. of.
Seventh Game: Learning Cost
Netizen evaluation 1:
As of now, laravel is better than thinkPHP There are great advantages. There is nothing wrong with preferring laravel in terms of pure application, but the reality is always cruel. In fact, laravel is always superior to novices when getting started.
In comparison, Laravel’s framework is indeed large. The big result is that there are a lot of concepts that you need to master, and a lot of APIs that need to be understood and used in practice. Moreover, you will go crazy when reading the article. Although there are Chinese community, but when you really encounter difficult-to-understand concepts, when you look at the documentation, you always don’t speak human language, and when you open the official website, it is all in English, which is bad luck for novice developers and novice developers with poor English skills.
Based on this, it is recommended that novice developers learn thinkPHP first. There are relatively few concepts and Chinese ecological communication is easy to understand. It is better to wait until they have certain development experience before trying laravel. A very interesting phenomenon is: after mastering laravel, you don’t want to go back to thinkPHP.
Netizen comment 2:
In fact, tp5 has absorbed a lot of new things since the beginning, and fans praise it extremely, just like his saying "Ten years of sharpening a sword", I am used to it. 3.0 and 5.0, which are plagued by diseases and have a huge user base, really make people feel more emotional, and they use it without hesitation; while opponents think that new features are nothing more than leftovers from Laravel, and if you come late, you will naturally copy homework.
When I was a novice, I learned two frameworks, tinkphp and laravel, at the same time. I heard other people say that one framework is low and the other is high-end, this is suitable for small projects, that is suitable for large projects, etc. …
As for the design idea, I still have no impression of it. It probably stems from the fact that Xiaobai didn’t have the awareness to understand this kind of thing at that time. After a few twists and turns, I found that tp is a good thing, because laravel didn’t feel it at all, what? Service containers, event queues, etc. are all top-notch. You don’t know me, I don’t know you, I just look at them in a daze.
I only have the English level of a kindergarten class when I see the class names, comments, and documents that don’t speak human language in Laravel. I have only one feeling in my heart: Once I enter Laravel, it is as deep as the sea, infinitely sad and hurtful. Then he decided to embark on the TP road.
What do you guys think?
##ThinkPHP Developer:
PHP Chinese website:
(1) ThinkPHP
1. Development using mvc ideas , the scope of influence is only domestic, free and open source, and the Chinese information is very rich (this sentence seems to be nonsense), it is the best choice for web development novices. 2. Starting from the classic ThinkPHP5, it is known as a high-performance framework designed for API development. It is simple to configure, extremely fast to get started, and the programming style is particularly pleasing to domestic developers. Therefore, once it was launched, it became popular all over the country and became the favorite of entrepreneurial teams, outsourcing companies, and personal studios! 3. The shortcoming is also obvious, that is, the ecology is not as complete as the international big-name framework. Just search for ThinkPHP's third-party development package on composer, but so what? The impact on the country is minimal. Course recommendation:
Registration for the 20th PHP online live class has begun!
Registration address: https://www.php.cn/k.html
This issue uses TP6 Vue3 API Element Plus focuses on building acomplete knowledge payment (distribution system) multi-merchant e-commerce system
Reservation activities (as of June 8th):
1. Deposit of 200 is worth 800 (refundable) 2. Sign up and you will be given the complete e-commerce (distribution) system source code worth 10,000 yuan for this period ( Can be used commercially without copyright risk) 3. Register in full and receive a free 3-month VIP membership PHP path course for early learningcourse registration consultation ↓↓↓QQ/WeChat: 27220243 (Teacher Zhong), WeChat: phpcn01 (Teacher Yueyue)
(QR code identification consultation)
(2) Laravel Framework
1. The shortcomings of ThinkPHP are almost all the advantages of Laravel, and the reverse is also true. 2. Laravel, known as the PHP framework created by WEB artists, is also currently the best advanced PHP framework for AP development. 3. The main application scenario of PHP is web development, and the Laravel framework achieves the ultimate. 4. It is updated frequently and is driven by the community. Countless masters around the world are constantly "contributing" to it. The ecosystem is rich. The function packages on composer are only what you can't think of and you can't find them.5. For newcomers, it is more difficult to get started than ThinkPHP, but once you get started, it seems like a new world has opened up.
6. Driven by some domestic communities, there have been more and more Chinese materials on laravel in recent years, and many web projects have been refactored with laravel.
Course Recommendation:
#php Chinese website's newly launched "Laravel 9 is the right time to learn - nanny-level tutorial, it's hard to learn!" 》Take you to experience Laravel 9, the latest version of the PHP framework specially built for Web craftsmen, making your code more like the work of an artist!
This course will start from scratch and teach you how to use the world's most popular PHP framework to develop any project, and save you a lot of development and maintenance time, improving development efficiency. !
Opening address: https://www.php.cn/course/1421.html
##(Recognize the QR code to open the course)

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The latest versions of Laravel 9 and CodeIgniter 4 provide updated features and improvements. Laravel9 adopts MVC architecture and provides functions such as database migration, authentication and template engine. CodeIgniter4 uses HMVC architecture to provide routing, ORM and caching. In terms of performance, Laravel9's service provider-based design pattern and CodeIgniter4's lightweight framework give it excellent performance. In practical applications, Laravel9 is suitable for complex projects that require flexibility and powerful functions, while CodeIgniter4 is suitable for rapid development and small applications.

Laravel - Artisan Commands - Laravel 5.7 comes with new way of treating and testing new commands. It includes a new feature of testing artisan commands and the demonstration is mentioned below ?

Compare the data processing capabilities of Laravel and CodeIgniter: ORM: Laravel uses EloquentORM, which provides class-object relational mapping, while CodeIgniter uses ActiveRecord to represent the database model as a subclass of PHP classes. Query builder: Laravel has a flexible chained query API, while CodeIgniter’s query builder is simpler and array-based. Data validation: Laravel provides a Validator class that supports custom validation rules, while CodeIgniter has less built-in validation functions and requires manual coding of custom rules. Practical case: User registration example shows Lar

For beginners, CodeIgniter has a gentler learning curve and fewer features, but covers basic needs. Laravel offers a wider feature set but has a slightly steeper learning curve. In terms of performance, both Laravel and CodeIgniter perform well. Laravel has more extensive documentation and active community support, while CodeIgniter is simpler, lightweight, and has strong security features. In the practical case of building a blogging application, Laravel's EloquentORM simplifies data manipulation, while CodeIgniter requires more manual configuration.

When choosing a framework for large projects, Laravel and CodeIgniter each have their own advantages. Laravel is designed for enterprise-level applications, offering modular design, dependency injection, and a powerful feature set. CodeIgniter is a lightweight framework more suitable for small to medium-sized projects, emphasizing speed and ease of use. For large projects with complex requirements and a large number of users, Laravel's power and scalability are more suitable. For simple projects or situations with limited resources, CodeIgniter's lightweight and rapid development capabilities are more ideal.

For small projects, Laravel is suitable for larger projects that require strong functionality and security. CodeIgniter is suitable for very small projects that require lightweight and ease of use.

Comparing Laravel's Blade and CodeIgniter's Twig template engine, choose based on project needs and personal preferences: Blade is based on MVC syntax, which encourages good code organization and template inheritance. Twig is a third-party library that provides flexible syntax, powerful filters, extended support, and security sandboxing.

Laravel - Pagination Customizations - Laravel includes a feature of pagination which helps a user or a developer to include a pagination feature. Laravel paginator is integrated with the query builder and Eloquent ORM. The paginate method automatical