1. Advantages
(1) Cross-platform, superior performance, combined with Linux/Unix, not Windows. The performance is 45% better, and it is very cost-effective when combined with many free platforms, such as LAMP (Linux /Apache/Mysql/PHP) or FAMP (FreeBSD/Apache/Mysql/PHP). If the data application is large enough, you can consider switching to PostgreSQL. Or Oracle, which supports N types of databases. (N >= 10)
(2) The syntax is simple, if you have learned C and Perl, it is easy to get started, and it is partially similar to ASP. There are mature development tools, such as NuPHPed, or Zend Studio, etc., and you can use Eclipse and so on under the Linux platform.
(3) Currently, mainstream technologies are supported, such as WebService, Ajax, XML, etc., which are sufficient for application.
(4) There is relatively complete support, such as using ADODB or PEAR::DB as the database abstraction layer, using Smarty or smart template as the template layer. If it is PHP 5.1, you can also use PDO (PHP Data Object) to access the database.
Related recommendations: "php tutorial"
(5) There are many mature frameworks, such as frameworks that support MVC: phpMVC; support event-driven events similar to ASP.net Frameworks: Prado; frameworks that support rapid development like Ruby On Rails: Cake, etc., which are enough to meet your application needs.
(6) PHP5 already has a mature object-oriented system and can adapt to basic object-oriented requirements. Suitable for developing large-scale projects.
(7) There is a mature community to support the development of PHP.
(8) Currently, many large-scale applications use PHP, such as Taobao, Yahoo, 163, Sina and other large portals. Many use PHP as their development language, so large portals can choose it. , I think it's enough for your use.
(9) There are many open source frameworks or open source systems that can be used. For example, the well-known open source frameworks include Zend Framework, CakePHP, CodeIgniter, symfony, etc., the open source forums include Discuz!, Phpwind, etc., and the open source blog WordPress , open source online store systems such as Ecshop, ShopEx, etc., and open source SNS systems such as UCHome, ThinkSNS, etc.
(10) Low cost of use (linux apache mysql php kernel)
2. Disadvantages
(1) Function naming is not standardized, camel case method and the lower line, the parameter transmission position is different.
(2) Single thread; PHP itself, PHP has always been a single-process program; although PHP's pthreads extension has long been available. But it is not stable enough, and it will hang up inexplicably while running; PHP extensions are all written in C, which means that if any extension has a thread competition resource control problem, the whole thing will hang up.
(3) The core asynchronous network is not supported (of course, there is only a synchronous non-blocking network model in Linux). But the lack of this makes it difficult to develop a network application that can withstand large concurrency. Both traditional network models and io are blocking. The basic programming approach is that a process (or thread) responds to a user connection request. Therefore, it is impossible to complete tasks like real-time online games that require thousands of network connections. Although PHP also has Libevent and eio extensions, which can make up for this to some extent, they don't feel so perfect.
(4) Only supports web development, it is not convenient to make .exe files, desktop applications, or mobile applications.
(5) It is not suitable for crawlers, automatic running scripts, and scientific computing projects. The basic structure of this language is not suitable, although there are many ways to achieve it.
(6) Difficulty in later maintenance. The speed-up space in the later period is quite limited.
(7) PHP’s interpretation and operation mechanism. This operating mechanism enables all related resources to be recycled after each PHP page is interpreted and executed. In other words, PHP has no way to make an object resident in memory at the language level. In PHP, all variables are page-level. Whether they are global variables or static members of the class, they will be cleared after the page is executed.
Take JSP as an example. In JSP, the scope of Java Bean has four valid values: Page, Application, Session, and Request, which correspond to the four lifetimes of page, program, session, and request respectively. But in PHP, there is only one lifetime of Page.
The above is the detailed content of What are the advantages and disadvantages of php development. For more information, please follow other related articles on the PHP Chinese website!