Home > Article > Backend Development > Can php make games?
Can PHP make games? PHP is a popular computer language now, but many netizens are asking whether PHP can develop games. After all, making games is the most profitable now. Here is an introduction to how to develop games in PHP!
Let’s talk about why PHP is not suitable for game backends. The following points (summarized by others, please don’t spray):
Native PHP does not support multi-threading. The native PHP language has almost no corresponding support solution for multi-threading. Although the third-party library Swoole can be installed to implement it, the system resources are high, so it is not as good as directly using C or JAVA; (Recommended learning: PHP Programming From entry to master)
cannot be resident in memory. PHP, as a web page script, almost does not involve resident memory. Although you can use set_time_limit(0) and ignore_user_abort() to keep the script running in the background, its reliability is not reached at all;
Cannot run as a background service. php is based on server software and cannot run independently;
PHP has poor high concurrency support.
So, to put it bluntly, PHP is relatively lazy. Once the user requests it, it responds once and does not actively run in the background. So it is not suitable as a game service backend.
Whether there is a future has something to do with people and has nothing to do with language. Not to mention PHP, if you learn any language to the extreme, you will have a bright future. In fact, you don’t need to reach the top level. Even if you are in the top 30% of the industry, your income will definitely be higher than that of most ordinary people. And all this does not require how high your background is, nor how rich your father is, it only requires you to be smart and talented.
The above is the detailed content of Can php make games?. For more information, please follow other related articles on the PHP Chinese website!