Home > headlines > body text

laravel VS thinkphp, how to decide?

青灯夜游
Release: 2022-06-02 20:51:15
Original
5633 people have browsed it

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

laravel VS thinkphp, how to decide?

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

laravel VS thinkphp, how to decide?

##Laravel is developed by the beautiful country Taylor Otwell, It is a permanently free, open source heavyweight PHP development framework. It was born in 2011. It is the most used in the world and is known as the PHP framework with the most design philosophy and art. See another article for details: Why is Laravel the most elegant PHP framework?

Popular versions:

Laravel 8.x: Released on September 8, 2020, PHP version >= 7.3

Laravel 9.x : Launched on February 8, 2022, only supports PHP 8.0/8.1

Who is better?


Let’s first take a look at what netizens say, and finally express the opinions of php Chinese website


laravel VS thinkphp, how to decide?

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:

It’s not that TP wants to learn from laravel, it’s just that the mainstream development ideas are converging. If TP wants to be in line with international standards, it must conform to mainstream development ideas and become a modern development framework. Good design always leads to the same goal through different paths.

TP used laravel for reference when designing the 5.0 version. Everyone only saw similar usage but could not see the difference in underlying implementation.

TP has absolutely no need and will not copy a laravel. It is completely based on its own user ecological considerations, and starting from 6.0, TP has followed its own model.

Many seemingly bad designs are just practical designs for ordinary developers, such as composer, a PHP beginner who has intercepted many times. It is easy to base the framework on composer, but the TP5 series version It has always been compatible with composer design rather than completely based on composer design (in fact, compatibility is more difficult than composer-based design).

It is for these reasons that a good product must consider its own user base. TP6 made a choice based entirely on composer based on the training of users in the two major versions of TP5. But building a domestic ecosystem is not easy, and more requires the understanding and contribution of developers. So there is no need to compare, choose the framework that suits you according to your own situation, including technical team, cost and other considerations.

Newbies should not be swayed by certain remarks. Laravel is indeed excellent, but thinkphp is not necessarily bad. There is no perfect framework. Try it and you will naturally understand whether it is suitable for you.

In fact, TP’s current ecology is getting better and better, and its user base is still growing. It can also be seen from the Baidu Index that the difference between the two is not big.

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 a

complete knowledge payment (distribution system) multi-merchant e-commerce system

laravel VS thinkphp, how to decide?

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 learning

course 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!

laravel VS thinkphp, how to decide?

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)

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template