New features after the PHP5.3

Source: Internet
Author: User
Tags functions mysql mysql client new features variable client

From PHP4 to PHP5, from the personal development of language to professional Internet development, witnessing the development of PHP from the cottage to the regular army. PHP6 is still brewing, believe PHP5 will be as PHP6 small test the ground. PHP5.3 is a milestone for PHP5, adding a lot of new features. PHP functions are more and more, but the syntax of PHP is getting uglier, sometimes adding new features, and new features bring new problems, to fix the problem and add new syntax to fix. There is no need to worry about a friend without the basics of PHP, and there is a basic understanding of PHP5.3 first. After learning the following knowledge to look back at the new characteristics of PHP5.3 you will have a new understanding and sentiment.

1, first of all the previous abuse of the grammar was standardized

It is well known that PHP has a good fault tolerance in the language development process, resulting in an array or global variable containing the string without quotation marks can not be an error, many amateur developers because of lazy security problems are very serious, The reason why PHP5.3 all the basic grammar and improve the writing standard, in fact, for the PHP developers writing is not much influence, but let them become more professional.

2, MySQL drive mysqli improve efficiency

PHP has been a MySQL client to connect MySQL, and now the MySQL official has launched the PHP version of the MySQL client, and this mysqlind effectively reduce the use of memory and improve performance

(1) Compile php more convenient, do not need libmysql, has been built in the source code

(2) Use PHP license to avoid copyright problems

(3) Use PHP memory management, support PHP memory limit (memory_limit)

(4) All data in memory only one, before the Libmysql has two

(5) Provide performance statistic function, help analysis bottleneck

(6) Adding caching mechanism to the drive layer

3, PHP5.3 Security and performance of the promotion

such as MD5 () probably improved the performance of 10%-15%, better memory processing mechanism, improve software performance access. Solve the include (require) _once repeatedly open problem, before the once are implemented with static variables, the GCC4 compiled with a smaller binary, the overall performance increased 5%-15%

4. Delay Static binding

PHP's static is fixed when precompiled, so when inheriting, self in the parent class is the parent class, not the subclass. php5.3 adds a new syntax static that captures the current class at run time

5. More new features

(1) name space, used to solve the naming of contaminated

(2) The new Magic function __callstatic the original __call static mode

(3) Support variable call static, can be called by $someclass:: $method ()

(4) New Date function Date_create_from_format

(5) New anonymous functions and closures similar to JavaScript

(6) New magic constant __dir__ to solve the path problem







Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.