Home  >  Article  >  Backend Development  >  Why can't PHP do large-scale systems?

Why can't PHP do large-scale systems?

青灯夜游
青灯夜游Original
2019-11-20 18:09:162694browse

Why is PHP not suitable for building large systems? Everyone must think it is a security issue. But it's not just that. Let me introduce it to you below.

Why can't PHP do large-scale systems?

Why can’t PHP be used in large systems? what is the reason?

Confusing License

You may think that PHP is free, and all PHP modules mentioned in the manual are also free. Wrong! For example, if you want to generate PDF files in PHP, you will find two modules in the manual: PDF and ClibPDF. But both of these are commercially licensed. So, for every module you use, you have to make sure you agree to its license.

Inconsistent function naming rules

Some function names are composed of multiple words. There are generally three habits of word combinations:

Direct splicing: getnumberoffiles

Separate with underscores: get_number_of_files

Camel's rule: getNumberOfFiles

Most languages ​​choose one of them One middle school. But PHP is used.

Magic quote hell

Magic quote can protect PHP scripts from SQL injection attacks. This is good. But for some reasons, you can turn off this configuration in php.ini. So if you want to write a flexible script, you always need to check whether magic references are on or off. Such a "feature" is supposed to make programming easier, but in fact it makes it more complicated.

Many PHP modules are not thread-safe

A few years ago, Apache released version 2.0 of the web server. This version supports multi-threading mode, in which one part of the software can run multiple parts at the same time. The inventor of PHP says that the core of PHP is thread-safe, but non-core modules may not be. But nine times out of ten, you want to use this module in a PHP script, but this makes your script incompatible with Apache's multi-threaded mode. This is why the PHP team does not recommend running PHP in Apache 2's multi-threaded mode. PHP's poor multi-threaded mode support is often cited as one of the reasons why Apache 2 remains unpopular.

Non-standard date format characters

Many programmers are familiar with date format characters, which come from UNIX and C languages. Several other programming languages ​​have adopted this standard, but strangely enough, PHP has its own set of completely incompatible date format characters. In C, "%j" represents the day of the year, and in PHP it represents the day of the month. However, to make things even more confusing: Smarty (a popular PHP template engine)'s strftime function and date_format function use C/UNIX formatting characters.

Recommended learning: PHP tutorial

The above is the detailed content of Why can't PHP do large-scale systems?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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