What changes have taken place from PHP5.3 to PHP7.1

巴扎黑
Release: 2023-03-15 09:34:01
Original
2635 people have browsed it


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.

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.

  • 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.)

PHP 5.4

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

  • 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.

PHP5.5

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

PHP5.6

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()

  • ##gost-crypto hashing algorithm

  • SSL/TLS improvement

  • pgsql asynchronous support

PHP7.0

https://secure.php.net /manual...

  • Scalar type declaration

  • Return value type declaration

  • null merge Operator

  • Spaceship operator (combination comparison operator)

  • Define constant array through define()

  • Anonymous class

  • Unicode codepoint translation syntax

  • ##Closure::call()
  • 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

PHP7.1

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!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!