Netbeans 8.2 will support PHP7 more exciting _php tips

Source: Internet
Author: User
Tags generator netbeans

First, set the PHP version of PHP Project to PHP 7.0.

One of the new features of PHP 7 is the return type declaration that PHP functions and methods can declare the return value of the specified type:

Another wonderful improvement of PHP 7 is the scalar type declaration of parameters, which is supported by the code completion feature of NetBeans.

NetBeans also supports the PHP 7 emerging operators:

Group Use declaration:



Constants can also be grouped by use:

Another big feature of PHP 7-anonymous class:

8.2 is still a long time from the release date, can't wait to taste it, download address:http://bits.netbeans.org/download/trunk/nightly/latest/

Note:

Build device

(PHP 5 >= 5.5.0, PHP 7)

The builder provides an easier way to implement simple object iterations, comparing the performance overhead and complexity by defining how the class implements the iterator interface.

The generator allows you to write code in the foreach code block to iterate over a set of data without creating an array in memory, which can limit your memory to a significant amount of processing time. Instead, you can write a generator function, just like a normal custom function, and the normal function only returns one time, the generator can be yield several times as needed to generate the values that need to be iterated.

A simple example is to use the generator to implement the range () function again. The standard range () function needs to generate an array in memory that contains each value in its range, and then returns the array, resulting in multiple large arrays. For example, calling range (0, 1000000) will result in memory consumption exceeding MB.

As an alternative, we can implement a xrange () generator that requires only enough memory to create the iterator object and to track the current state of the generator internally, which requires less than 1K bytes of memory.

This article source: http://www.cnblogs.com/x3d/

The above is the entire content of this article, I hope to help you learn, more wonderful content please pay attention to cloud habitat community.

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.