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.
Core:
For closed resources, thegettype()function will returnresource (closed), replacing the previousunknown type.
For__PHP_Incomplete_Classclass 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)orsettype()), 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 nativetraitattribute values.
objectwill not be used as a class name.
BcMath
## andfmod()The function is the same, thebcmod()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()andhash_init()(when the options parameter isHASH_HMAC), these functions will no longer support non-encrypted hash functions.
json_decode()When the second parameter assoc of the function is null, the options support optionJSON_OBJECT_AS_ARRAYwill be enabled, before This parameter has been ignored by us in the version.
##Session#Move In addition to
related code, "!" can be used in the key name of$_SESSION.
session##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 theini_set()function , invalid ini modification operations will not succeed.
session_start()), someE_ERROR Error messages of levelwill be converted to levelE_WARNING.
session_name(),session_module_name(),session_save_path(),session_cache_limiter()andsession_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()andrand()with the same seed may be different. Same.
##2. New Features
Core
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.
json_encode()andjson_decode()Added support forJSON_INVALID_IGNOREand ## Support for#JSON_INVALTD_UTF8_SUBSTITUTEreplaces 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_DUPNAMESSodium
##New encryption extension.
##SQLite3
##Implementation to write BLOBs.
windows platform supports the
function.
Zip
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 theZipArchive::count()
method.4. Deprecated functionality
Core
## Track errors in the configuration file will be Abandoned.
##__autoload()
will be deprecated, useinstead.
(unset)will be abandoned. This change will not affectunset ($var)language structure.
create_function()The function will be deprecated and replaced by an anonymous function.##each()
foreach()Loop instead.
##read_exif_data ()will be deprecated, use
exif_read_data()
png2wbmp()andjpeg2wbmp()will be deprecated.
GMP
##gmp_random ()will be deprecated, usegmp_random_bits()or () instead.
Intl
#INTL_IDNA_VARIANT_2003will be deprecated, useINTL_IDNA_VARIANT_UTS46instead.
Mbstring
##mbstring The configuration file of .func_overloadwill be discarded.
parse_str()will be discarded.
Callingwith string parameters will be deprecated and use regular expressions instead.
Standard
PASSWORD_ARGON2I,password_hash()Argon2 hash can be generated.
memory_cost,time_cost. The default value for these options isPASSWORD_ARGON2_DEFAULT_MEMORY_COST. If not set, the defaults arePASSWORD_ARGON2_DEFAULT_TIME_COSTandPASSWORD_ARGON2_DEFAULT_THREADS.
Argon2 hashes can be verified.
##password_get_info()password_needs_rehash()can Accepts Argon2 hashes.#mail()/mb_send_mail()
$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()
andSupports 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()6. New functions
Addstream_istty()
.Addedsapi_windows_vt100_support()
.##DOM
Implemented Countable and addedDomNodeList::count()
.DOMNamedNodeMapImplements Countable and addsDOMNamedNodeMap::count().
FTP
##increaseftp_append().
GD
##increaseimagesetclip()andimagegetclip().
Addedimageopenpolygon().
Addedimageresolution().
Addedimagecreatefrombmp()andimagebmp( ).
Hash
##increasehash_hmac_algos().
mb_chr()andmb_ord().
mb_scrub.
##OCI8##increase Added
andoci_unregister_taf_callback()support for Transparent Application Failover (TAF) for Oracle databases.Sockets
##increase The
,socket_addrinfo_connect(),socket_addrinfo_bind()andsocket_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.
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()##GD
--enable-gd-native-ttfconfiguration 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
Accepts an array parameter and recursively checks its keys and values.
Accepts an array parameter, the encoding of its value can be converted recursively.
PDO_OCI
##--with-pdo-oci The configuration syntax ofis no longer available for Oracle clients.
##pdo_sqlite
##Usesqlite3_prepare_v2()andsqlite3_close_v2()to replace their previous functions.
Core
##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_THREADS
##PASSWORD_ARGON2I
11. Changes in INI file handling
sql.safe_mode
This INI option has been removed.
##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:
Introduction to new features in PHP7