PHP7.2 version performance introduction
This article mainly introduces the performance of PHP7.2 version to you in detail, hoping to help everyone have a clearer understanding of PHP7.2.
1. Backward-incompatible changes
Core:
For closed resources, the gettype() function will return resource (closed), replacing the previous unknown type.
For __PHP_Incomplete_Class class object, is_object ()The function will return true.
#Remove support for Netware operating system.
array type is converted to object type ((object)orsettype() ), the integer key will be converted into an attribute name, which fixes the problem that the numeric key in the previous version cannot be used as an attribute name.
Convert object type to array type ((array)or settype() ), and when the properties of an object are mapped to an array (get_object_vars()), the integer properties will be converted into numeric keys, which fixes the previous version The problem of inaccessible integer properties.
Unqualified reference to an undefined constant will result in a warning level error, replacing the previous notice level, and subsequent versions will be error level errors. .
#The minimum supported Windows versions are Windows 7 and Windows Server 2008 R2.
Cancels the compatibility checking behavior of native trait attribute values.
object will not be used as a class name.
BcMath
## and fmod()The function is the same, the bcmod() function cancels the modulo operation (%), that is, the decimal part of the value is truncated into an integer. For example: bcmod('4', '3.5') will return 0.5 instead of 1.
Hash
##hash_hmac (), hash_hmac_file(), hash_pbkdf2() and hash_init() (when the options parameter is HASH_HMAC), these functions will no longer support non-encrypted hash functions.
- ##When
json_decode()When the second parameter assoc of the function is null, the options support option JSON_OBJECT_AS_ARRAY will be enabled, before This parameter has been ignored by us in the version.
##Session
#Move In addition to
- register_globals
related code, "!" can be used in the key name of $_SESSION.
session - is used to correctly manage the session state and prohibit invalid operations. When there is a problem with the code, it will will trigger the change. If you unfortunately encounter this problem, it means there is a problem with your code.
##sesseion_start()
session_status(), session_regenerate_id(), these functions are used to set or return the correct session state.
##session_unset(), session_write_close()/ session_commit(), session_abort(), session_reset(), these functions return no return value. Returns a Boolean value. They allow empty parameters and have checks for these empty.
##session_start(), session_set_cookie_params(), session_name(), session_module_name(), session_set_save_handler(), session_regenerate_id(),session_cache_limiter(),session_cache_expire(),session_unset(), session_destroy(), session_write_close()/ session_commit(), session_reset(), these functions will disable invalid session status and http header status, and return the correct Boolean value or numerical value.
##session.name, session.save_path, session.cookie_lifetime,session.cookie_path,session.cookie_domain,session.cookie_httponly,session.cookie_secure,session.use_cookies,session.use_only_cookies,session.use_strict_mode,session.referer_check, session.cache_limiter,session.cache_expire,session.lazy_write,session. save_handler,session.serialize_handler,session.gc_probability,session.gc_pior, session.gc_maxlifetime, the setting of these ini values must be successfully called by the ini_set() function , invalid ini modification operations will not succeed.
Because the session can be managed correctly (session_start()), some E_ERROR Error messages of level will be converted to level E_WARNING.
Sessions will no longer be initialized with invalid and useless sessions - ##When the header information has been sent, setting the new ini value will be invalid at this time (via
session_name(), session_module_name(), session_save_path(), session_cache_limiter() and session_cache_expire() These functions).
Now these correct behaviors will affect the state of management sessions in cli command line mode. Using output buffering as in web applications will solve the problem with cli scripts.
- ,
Since version 7.1 , on a 64-bit machine, the order of random numbers generated by
mt_rand()and rand() with the same seed may be different. Same.
##2. New Features
Core
- When overriding a method or interface, its parameter type can be omitted. This obeys the contravariance of the parameter type of the Liskov equilibrium principle.
Allows the inherited abstract class to override the abstract method of the inherited abstract class.
# Allows trailing commas to group namespaces.
#Annotations for object types are allowed.
##DBA
##Implementation Added support for LMDB backend.
- ##at
json_encode() and json_decode() Added support for JSON_INVALID_IGNORE and ## Support for #JSON_INVALTD_UTF8_SUBSTITUTE replaces the previous utf-8 encoded invalid type. ##OCI8
##increase Provides support for Transparent Application Failover (TAF) of Oracle Database.
PCRE
##increase Internal option (j) modifies the local
PCRE_DUPNAMES- option.
Sodium
##New encryption extension.
##SQLite3
##Implementation to write BLOBs.
- Standard
windows platform supports the
- proc_nice()
function.
Zip
##Read /Write encrypted archive, depends on libzip 1.2.0, New method:
ZipArchive:: setEncryptionName($name, $method[,$password]); ZipArchive::setEncryptionIndex($index, $method[ , $ password]); New constants: ZipArchive:: EM_NONE ZipArchive:: EM_AES_128 ZipArchive:: EM_AES_192 ZipArchive:: EM_AES_256
-
##Accepts "password" from the zip stream context. ZipArchive implements countability and adds the ZipArchive::count()
method. 4. Deprecated functionality
Core
## Track errors in the configuration file will be Abandoned.
##__autoload()
will be deprecated, use- spl_autoload_register()
instead.
(unset) will be abandoned. This change will not affect unset ($var) language structure.
create_function()The function will be deprecated and replaced by an anonymous function. ##each()
Function structure will be deprecated, use foreach()Loop instead.
- Exif
##read_exif_data () will be deprecated, use
exif_read_data()
- GD
png2wbmp() and jpeg2wbmp() will be deprecated.
GMP
##gmp_random () will be deprecated, use gmp_random_bits() or () instead.
Intl
#INTL_IDNA_VARIANT_2003 will be deprecated, use INTL_IDNA_VARIANT_UTS46 instead.
Mbstring
##mbstring The configuration file of .func_overload will be discarded.
- ##No need Parameters to call
parse_str() will be discarded.
Calling - assert()
with string parameters will be deprecated and use regular expressions instead.
5. Changed functions
Standard
- When set to
PASSWORD_ARGON2I, password_hash()Argon2 hash can be generated.
##When using PASSWORD_ARGON2I, the following options may be set by default: memory_cost , time_cost. The default value for these options is PASSWORD_ARGON2_DEFAULT_MEMORY_COST. If not set, the defaults are PASSWORD_ARGON2_DEFAULT_TIME_COST and PASSWORD_ARGON2_DEFAULT_THREADS.
password_verify()-
Argon2 hashes can be verified.
##password_get_info() - and
password_needs_rehash() can Accepts Argon2 hashes. #mail()/mb_send_mail()
Accepts array -
$extra_header . Array parameters are checked against RFC 2822. Array format: php $extra_headers = [ 'Header-Name' => 'Header value', 'Multiple' => ['One header', 'Another header'], 'Multiline' = " FirstLine\r\n SecondLine", ]; ##When an invalid parameter is passed, count()
The function will throw warning warning. -
In big-endian and little-endian byte order, pack()
and - unpack()
Supports float and double types. number_format()
The function will ensure that the zero value does not contain a negative sign. ##XML
#utf8_encode () and
utf8_decode()- functions have been moved to the standard extension as strings.
6. New functions
Core
Add stream_istty()
.-
Addedsapi_windows_vt100_support()
. ##DOM
Implemented Countable and added DomNodeList::count()
.DOMNamedNodeMapImplements Countable and adds DOMNamedNodeMap::count().
FTP
##increase ftp_append().
GD
##increase imagesetclip() and imagegetclip().
Addedimageopenpolygon().
Addedimageresolution().
Added imagecreatefrombmp() and imagebmp( ).
Hash
##increase hash_hmac_algos().
- ##increase
mb_chr() and mb_ord().
- Added
mb_scrub.
##OCI8
##increase Added
- oci_register_taf_callback()
and oci_unregister_taf_callback() support for Transparent Application Failover (TAF) for Oracle databases. Sockets
##increase The
- socket_addrinfo_lookup()
, socket_addrinfo_connect(), socket_addrinfo_bind() and socket_addrinfo_explain(). SPL
##increase
spl_object_id()- .
7. New classes and interfaces
8. Move Extensions and SAPI
Mcypt
# #The deprecated mcrypt extension has been moved to PECL.
libmcrypt has not been maintained since 2007 and continued use of this extension is not recommended.
- 9. Other changes to the extension
Added exif tag support for the following formats: Samsung, DJI, Panasonic, Sony, Pentax, Minolta, Sigma/Foveon, AGFA, Kyocera, Ricoh & Epson.
-
##exif_read_data() and
exif_t humbnail() - Supports passing streams as the first argument.
##GD
--enable-gd-native-ttf configuration option.
imagegd() Store the truecolor image as a true color image, replacing the previous conversion to color correction plate.
mageantialias() is also supported when compiling with system libgd.
Mbstring
##mb_check_encoding ()
Accepts an array parameter and recursively checks its keys and values.
- ##mb_convert_encoding()
Accepts an array parameter, the encoding of its value can be converted recursively.
PDO_OCI
##--with-pdo-oci The configuration syntax of is no longer available for Oracle clients.
##pdo_sqlite
##Use sqlite3_prepare_v2() and sqlite3_close_v2() to replace their previous functions.
Core
- ##PHP_FLOAT_DIG
##PHP_FLOAT_EPSILON
PHP_FLOAT_MIN
PHP_FLOAT_MAX
PHP_OS_FAMILY
-
Fileinfo
##FILEINFO_EXTENSION
GD
#IMG_EFFECT_MULTIPLY
IMG_BMP
-
##PCRE
PREG_UNMATCHED_AS_NULL
##Standard:
##PASSWORD_ARGON2_DEFAULT_MEMORY_COST
- ##PASSWORD_ARGON2_DEFAULT_TIME_COST
PASSWORD_ARGON2_DEFAULT_THREADS
##PASSWORD_ARGON2I
11. Changes in INI file handling
sql.safe_mode
- realpath_cache_size
##opcache.fast_shutdown
-
This INI option has been removed. A variant of fast_shutdown handling has been integrated into the PHP kernel and will be enabled by default in production environments.
12. Windows support
-
Support VT100 console mode.
13. Other changes
Compilation system
The minimum supported version of autoconf is 2.64.
Related recommendations:
- How to install IIS, MySQ, nginx, php7.1.7 under Win10?
Introduction to new features in PHP7
Detailed explanation of the key to doubling the performance of PHP7

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Validator can be created by adding the following two lines in the controller.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

CakePHP is an open source MVC framework. It makes developing, deploying and maintaining applications much easier. CakePHP has a number of libraries to reduce the overload of most common tasks.

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an