The PHP 7 line, which debuted a year ago, has received its first point release upgrade, improving performance and featuring nullable types.
Version 7.1.0 also offers capabilities like a void return type and class constant visibility modifiers. But a key PHP advocate stressed performance. The upgrade “[provides] up to 35 percent better performance in CPU-intensive workloads,” said Zeev Suraski, CTO at PHP tools producer Zend.
Nullable types in 7.1 allows a check type to be of some type or null. “Type declarations for parameters and return values can now be marked as nullable by prefixing the type name with a question mark. This signifies that as well as the specified type, null can be passed as an argument, or returned as a value, respectively,” documentation states.
Version 7.1 also supports class constant visibility to mirror the behavior of method and property visibility. “Class constant may be defined as public, private or protected. class constants declared without any explicit visibility keyword are defined as public,” according to the proposal.
Submitted by: Arnfried Walbrecht
Comments are closed.