Abstract: This article comes from the official PHP documentation. It will not be expanded here. It is given to interested friends as a research list. PHP 5.3 https://secure.php.net/manual... Added namespace support. Added static late binding support. Added jump tag support. Added native closure (Lambda/anonymous function) support. ...
This article comes from the official PHP documentation. It will not be expanded here. It is given to interested friends as a research list.
https://secure.php.net/manual...
Added namespace support.
Added static late binding support.
Added jump tag support.
Added native Closure (Lambda/anonymous function) support.
Added two new magic methods, __callStatic and __invoke.
Added Nowdoc syntax support, similar to Heredoc syntax, but including single quotes.
It becomes possible to initialize static variables and class properties/constants using Heredoc.
Double quotes can be used to declare Heredoc, which supplements the Nowdoc syntax.
The const keyword can be used outside the class to declare constants.
The ternary operator has a short form: ?:.
The HTTP stream wrapper will treat all status codes from 200 to 399 as success.
Dynamic access to static methods becomes possible.
Exceptions can be embedded.
A garbage collector for circular references has been added and is enabled by default.
mail() now supports email sending logs. (Note: Only emails sent through this function are supported.)
https://secure.php.net/manual...
Added support for traits.
New short array syntax, such as $a = [1, 2, 3, 4]; or $a = ['one' => 1, 'two' => ; 2, 'three' => 3, 'four' => 4]; .
Added support for member access analysis of arrays returned by functions, such as foo()[0].
Now closures support $this .
Now = will always be available regardless of whether the short_open_tag php.ini option is set or not.
Added access to class members during instantiation, for example: (new Foo)->bar() .
Class::{expr}() syntax is now supported.
Add binary direct value, for example: 0b001001101.
Improved parsing error messages and warnings for incompatible parameters.
SESSION extension now tracks file upload progress.
Built-in CLI mode web server for development.
https://secure.php.net/manual...
New Generators
New finally keyword
foreach now supports list()
empty() supports any expression Formula
array and string literal dereferencing ¶
New password hashing API
Improvements GD
https://secure.php.net/manual...
Use expressions to define constants
Use... operators to define variable-length parameter functions
Use ... operator for parameter expansion
Use ** for exponentiation
use function and use const
phpdbg
Default character encoding
php://input is reusable
Large file upload (can now support file uploads larger than 2GB)
GMP supports operator overloading
Use hash_equals() Compare strings to avoid timing attacks
__debugInfo()
Provide filtering for unserialize()
IntlChar
Expected
Group use declarations
Generators can return expressions
Generator delegation
Integer division function intp()
Session options
preg_replace_callback_array()
CSPRNG Functions
You can use the list() function to expand objects that implement the ArrayAccess interface
Other features
https://secure.php.net/manual...
Nullable type
Void function
Symmetric array destructuring
Class constant visibility
iterable pseudo-class
Multiple exception capture processing
list() now supports key names
Support negative string offset
ext/openssl Support AEAD
Convert callables to closed through Closure::fromCallable() Package
Asynchronous signal processing
HTTP/2 server push support in ext/curl
The above is the detailed content of What changes have taken place from PHP5.3 to PHP7.1. For more information, please follow other related articles on the PHP Chinese website!