What changes have been used in PHP in several versions

Source: Internet
Author: User
Tags integer division what php
Often there are small partners in the process of learning PHP due to version inconsistencies, encounter some compatibility issues. Here we take a look at what PHP is currently doing with a larger number of versions, and which features need to be available to run.

This article comes from the official PHP documentation, which will not be launched and sent to a small partner to do research lists.


PHP 5.3

Added support for namespaces. Added support for static late binding. Added support for skip tags. Added support for native closures (lambda/anonymous functions). Added two magic methods, __callstatic and __invoke. Add Nowdoc syntax support, similar to Heredoc syntax, but contains single quotation marks. Use Heredoc to initialize static variables and class properties/constants to be possible. You can use double quotation marks to declare Heredoc, which complements the Nowdoc syntax. You can declare constants using the Const keyword outside of the class. The ternary operator has a shorthand form:? :. The HTTP streaming wrapper treats all status codes from 200 to 399 as successful. Dynamic access to static methods becomes possible. Exceptions can be embedded. A garbage collector with circular references is added and is turned on by default. Mail () now supports mail sending logs. (Note: Only messages sent through this function are supported.)


PHP 5.4

Added support for traits. Added short array syntax, such as $a = [1, 2, 3, 4]; or $a = [' one ' + = 1, ' One ' and ' 2 ', ' three ' + 3, ' four ' + 4];. Added support for member access parsing of function return arrays, such as foo () [0]. Closures now support $this. Now <?= will always be available regardless of whether the Short_open_tag php.ini option is set. New access to class members when instantiated, for example: (New Foo)->bar (). CLASS::{EXPR} () syntax is now supported. Added binary direct volume, for example: 0b001001101. Improved warnings for parsing error messages and incompatible parameters. The SESSION extension can now track the upload progress of a file. Built-in CLI-mode Web server for development.


PHP5.5

New generators New finally keyword foreach now supports list () empty () support for arbitrary expression array and string literal dereferencing¶ Newly password hash API improved GD


PHP5.6

Use an expression to define constants using ... Operators define variable-length parameter functions using ... Operator for parameter expansion use * * for power operation using function and use constphpdbg default character encoding Php://input is reusable for large file uploads (can now support file uploads larger than 2GB) GMP support operator overloading using HASH_EQ Uals () comparison string avoids timing attack __debuginfo () gost-crypto hash algorithm SSL/TLS elevation pgsql Async Support


PHP7.0

Scalar type declaration return value type declaration NULL merge operator Spaceship operator (combination comparer) define constant array by define () anonymous class Unicode codepoint translation Syntax Closure::call () to Unserialize () Provides filtering Intlchar expected group use declarations generator can return an expression Generator delegation integer division function intp () session option Preg_replace_callback_array () CSPRNG functions can use the list () function to expand other properties of an object that implements the Arrayaccess interface


PHP7.1

Nullable (Nullable) type void function symmetric array destructuring class constant visibility iterable pseudo-class multiple exception capture processing list () now supports key name support for negative string offsets EXT/OPENSSL support Aead closure::fromcallable () turns the callables into a closed-packet asynchronous signal Processing HTTP/2 server push support in Ext/curl

Related recommendations:

Course PHP7 New Features Brochure

Make your PHP7 faster hugepage usage Analysis

Parsing PHP5.6.30 and apache2.4.x configuration

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.