PHP Digest number 57 - interesting news, materials and tools (February 9 - 22, 2015)
We offer to your attention another selection with links to news and materials.
Enjoy reading! ')
News and Releases
PHP releases: 5.6.6 , 5.5.22 and 5.4.38 - Updates on current branches. Fixed two vulnerabilities and fixed bugs . Vulnerability CVE-2015-0235 is related to the possibility of a GHOST attack due to the direct transfer of gethostbyname() arguments to the corresponding Glibc function. Vulnerability CVE-2015-0273 is caused by a call to already freed memory areas when decoding DateTimeZone data via an unserialize() call.
Expected in HHVM - New features are listed in the upcoming release of HHVM 3.6, for example, asynchronous requests to MySQL. And also about plans for 2015.
RFC: Scalar Type Hints - The proposal can rightly be called the most controversial and discussed in the history of PHP. Pascal Martin described in detail the essence of the proposal in his post. Also in support of the proposal made by Anthony Ferrara, outlining the arguments for in his blog. Nevertheless, the stumbling block was the question of the severity of typing and a number of fair counterarguments led by Rasmus Lerdorf in the comments , Zeev Surasky in php.internals and many others . Voting ended with a score of 67 for and 34 against, which means that only one vote was not enough for its adoption. In this regard, the author of the proposal Andrea Faulds, announced that he was ceasing work on PHP and withdraws his RFCs, including Scalar Type Hints, Spaceship / Combined Comparison Operator, Void Return Type, Big Integer Support. Despite this, the work on the proposal was picked up by other core contributors, which resulted in proposals from Anthony Ferrar - Scalar Type Hints v5 and from Zeev Surasky - RFC: Coercive Types for Function Arguments .
RFC: Make empty () a Variadic - It is proposed to add to the function empty() ability to pass any number of arguments: if (empty($a, $b, $c)) {} .
RFC: Context Sensitive Lexer - Adopting this sentence will allow you to use certain keywords as class names or methods.
RFC: In Operator - It is proposed to add a new operator in , which will make it easier to check for the occurrence of an element in a string or array: $contains = "foo" in ["foo", "bar"]; // true$contains = "foo" in ["foo", "bar"]; // true
RFC: Encapsulation — It is proposed to implement the encapsulation of classes, interfaces, and traits at the namespace level. Thus, a class declared as private in a namespace will only be available inside that namespace.
RFC: Sum Types - Starting with version 5.1 in PHP, the ability to explicitly specify the type of parameters has been added, while PHP 7 supports the indication of types of return values. It is proposed to add the ability to specify several types for these cases, for example: function (array|Traversable $in) {}
Instruments
Mondrian - A set of console utilities for static code analysis. Allows you to identify and refactor strongly coherent code.
Using StackPHP middleware in Laravel 5 - In Laravel 4.1, StackPHP compatibility was implemented, but Laravel 5 implemented its own interface for middleware components. Post about how to return compatibility.