New features of PHP5.6.x

Source: Internet
Author: User
: This article mainly introduces the new features of PHP5.6.x. if you are interested in the PHP Tutorial, please refer to it. Internal operator overload (internal-operator-overloading)

Internal operator overloading is the first, because it is the most fun and strange.

In this GMP object (yes, yes, it's the object !!) Support operator overloading and conversion to scalar

One example is to reload the gmp _ * module.

The

After reload

In this example, the + operator is overloaded as gmp_add, and the * operator is overloaded as gmp_mull. The previous functional-based code made the details of a lot of algorithms invisible, and changed it to operator-based.

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. This improvement .. Xi dapupben.

In addition to the poor ONE, other visual tests are used.

Use function and use const)

The use operator starts to support the import of functions and constants. QwQ

Let's talk about the code.

The output result of this code is

Do you see the usage of the use function and use const structures?

Parameter unpacking function (Argument unpacking ...)

When calling a function, we always feel uncomfortable using the... Operator (operators with the same ellipsis ..) You can unpack an array or a traversal object to the parameter list.

This output is a 6

New Global variables)

Global variables are always important. let's take a look at the new global variables.

LDAP

  • LDAP_ESCAPE_DN

  • LDAP_ESCAPE_FILTER

OpenSSL

  • OPENSSL_DEFAULT_STREAM_CIPHERS

  • STREAM_CRYPTO_METHOD_ANY_CLIENT

  • STREAM_CRYPTO_METHOD_ANY_SERVER

  • STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT

  • STREAM_CRYPTO_METHOD_TLSv1_0_SERVER

  • STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT

  • Stream_crypto_method_tlsv1_encryption server

  • STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT

  • STREAM_CRYPTO_METHOD_TLSv1_2_SERVER

PostgreSQL

  • PGSQL_CONNECT_ASYNC

  • PGSQL_CONNECTION_AUTH_ OK

  • PGSQL_CONNECTION_AWAITING_RESPONSE

  • PGSQL_CONNECTION_MADE

  • PGSQL_CONNECTION_SETENV

  • PGSQL_CONNECTION_SSL_STARTUP

  • PGSQL_CONNECTION_STARTED

  • PGSQL_DML_ESCAPE

  • PGSQL_POLLING_ACTIVE

  • PGSQL_POLLING_FAILED

  • PGSQL_POLLING_ OK

  • PGSQL_POLLING_READING

  • PGSQL_POLLING_WRITING

  • PGSQL_CONNECTION_MADE

Note:

But because it is a new statement, many IDE will...

Looking forward to updates

The above introduces the new features of PHP5.6.x, including some content. I hope my friends who are interested in PHP tutorials can help me.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.