PHP5.6 has released Alpha, indicating that the next major version is coming soon. What new features does PHP5.6 bring? This article will introduce these features and discuss the benefits they can bring to developers. Constant Scalar expressions (Constantscalarexpressions) in constants, attribute declarations, and function parameter default value declarations, earlier versions only allow constant
PHP5.6 has released Alpha, indicating that the next major version is coming soon. What new features does PHP5.6 bring? This article will introduce these features and discuss the benefits they can bring to developers. When Constant scalar expressions (Constant scalar expressions) are declared as constants, attribute declarations, and function parameter default values
PHP5.6 has released Alpha, indicating that the next major version is coming soon. What new features does PHP5.6 bring? This article will introduce these features and discuss the benefits they can bring to developers.
Constant scalar expression (Constant scalar expressions)
When constants, attribute declarations, and function parameter default values are declared, only constant values are allowed in previous versions. In PHP5.6, scalar expressions containing numbers, string literal values, and constants are allowed.
The above code output:
4 The value of THREE is 3
Variable Parameter functions (Variadic functions ...)
Variable Parameter functions are no longer dependent on the func_get_args () function. Now you can use the new operators....
More concise implementation.
The above code output:
$req: 1; $opt: 0; number of params: 0$req: 1; $opt: 2; number of params: 0$req: 1; $opt: 2; number of params: 1$req: 1; $opt: 2; number of params: 2$req: 1; $opt: 2; number of params: 3
Parameter unpacking function (Argument unpacking ...)When calling a function...
Operators can unpack arrays or traversal objects to the parameter list, which is similar to the extension (splat) Operator in Ruby and other languages.
The above code output:
6
Use function and use const)use
The operator starts to support the import of functions and constants.use function
Anduse const
Structure usage example:
The above code output:
42Name\Space\f
PhpdbgPHP comes with an interactive debugger phpdbg, which is an SAPI module. For more information, see phpdbg.
Php: // input can be reusedphp://input
Supports multiple open and read operations, which greatly improves the memory usage of the POST data processing module.
Large file upload supportYou can upload large files larger than 2 GB.
GMP supports Operator OverloadingGMP objects support Operator Overloading and conversion to scalar, improving code readability, such:
Added the gost-crypto hash algorithm.Implemented Using CryptoPro S-box tablesgost-crypto
For details about the hash algorithm, see RFC 4357 and section 11.2.
SSL/TLS ImprovementOpenSSL extension adds the certificate fingerprint extraction and verification functions,openssl_x509_fingerprint()
Used to extract the fingerprint of the X.509 Certificate. The SSL stream context option is as follows:capture_peer_cert
Used to obtain the peer X.509 Certificate;peer_fingerprint
Used to assert that the Peer certificate matches the given fingerprint.
In addition, you can use the SSL stream context Optioncrypto_method
Specify the encryption method, such as SSLv3 or TLS. Currently, the supported options include STREAM_CRYPTO_METHOD_SSLv2_CLIENT, cipher, STREAM_CRYPTO_METHOD_SSLv23_CLIENT (default), or STREAM_CRYPTO_METHOD_TLS_CLIENT.
Turn: http://wulijun.github.io/2014/01/25/whats-new-in-php-5-6.html
Original article address: New Features of php 5.6, thanks to the original author for sharing.