The digest of interesting news and materials from the world of PHP for the last two weeks, No. 14 (03/26/2013 - 04/08/2013)
We bring to your attention another collection with links to news and materials.
Enjoy reading! ')
News and Releases
Traditionally, on April 1, the Internet was shaking from side to side from deafening "news". And the PHP world is no exception. So, Yii2, which many are eagerly awaiting, will be rewritten in Ruby . But what about Ruby! And without that, the productive PHP framework Phalcon, written in C, will be rewritten in assembly language . In addition, the PHP-FIG group was forced to admit that the decision to use spaces instead of tabulation for indentation was not at all correct, and this time the tabs won! And of course the most important was the “news” that the PHP project team decided to finally release PHP 6.0 instead of 5.5.
PHP 5.5 beta2 was released - The next beta came out a bit earlier than the planned date, which means that there are chances to see a stable version in the spring. In the release of a few bug fixes, a complete list of changes here .
Zend Framework 1 moves to Git - The framework code has been moved to GitHub . Zend Framework 1 is in the support stage, which will be suspended after a year and a half. Pull-requests are accepted only for corrections, but does this mean that you can expect a fork of ZF1?
Php
Comparison operators in PHP are very strange ... - Nikita Popov's answer to StackOverflow on foreach work was mentioned in previous releases. This time, Nikita answers the question about comparison operators. For example, the == operator is not reflexive, that is, $a == $a not always true.
Help, memory leaks in PHP! - Excellent slides from core developer and release manager PHP 5.5 Julien Pauli. Lots of useful information about how PHP works from the inside.
PHP is meant to die - In the post the author says that PHP has never been designed for long continuous execution. It is assumed that the script in a short time will perform the task and "die." That is why PHP didn’t care much about memory leaks and other problems.
Podcasts
Digests usually do not cover PHP podcasts, but the release of a new podcast from Zend was a good reason to review all existing ones.
/ dev / hell - A podcast on web development, one of whose authors is the notorious The Grumpy Programmer - the author of the PHPUnit Cookbook .
PHP Town Hall - This podcast is created by two active developers from CodeIgniter and Laravel communities - Ben Edmunds and Phil Sturgeon . The latter is also the creator of PyroCMS and a member of PHP-FIG. To record a podcast, they invite a well-known personality from the PHP community and discuss current topics.
Lately in PHP - Video podcast, authored by Manuel Lemos , creator of the PHP Classes resource. The latest news from the PHP world is discussed in video chat with other PHP figures.
PHP Podcast - The new Zend podcast created by Joe Stagner . In the first issue, Cal Evans is visiting and discussing the development of the PHP community.
Study materials
The first look at React - React is nothing more than the implementation of the Reactor pattern in PHP. The library allows you to create asynchronous event-based applications a la Node.js. The link is a small introductory tutorial, more information in the video of the excellent report from the author of the library. In addition, several examples of simple applications in the videos on the official channel React In Action .
We meet Boris: an improved REPL for PHP - Boris is a more advanced interactive programming environment than PHP’s built-in, which, in turn, can be accessed by calling php -a . The link is a small tutorial, which tells about the installation, setting up the library of Boris, as well as an example of its use in another application.
Apache2 vs. Nginx and PHP Applications - The author of the article conducted several tests of Apache2 and Nginx while serving PHP applications. Three types of applications were used for testing: a large application on Zend Framework 1, a small PHP script and WordPress. The result is quite expected: Nginx gives the statics quickly, but when it comes to generating pages with PHP, the difference is not significant.
About empty return values - The author of the post declares the rule: "If the function returns a collection, then the empty value must also be a collection." Or generally: “The type of returned values ​​must remain unchanged.” And in the post argues in favor of this rule.
Round table: the use of exceptions - The article is presented in the form of a discussion of the topic by several developers. Each gives their arguments and examples. An interesting format and many interesting thoughts.
PHP is not dead - In the post the author writes about how the situation has changed in the PHP world since 2007 . At that time, the fourth most popular version was, and PHP5 was installed on less than 20% of servers, and this despite the fact that she was at least 2 years old! It would be interesting to look at the adoption schedule of the latest versions to understand how the situation has improved, but the rest of the post only contains statistics on the use of PHP in general.
Code Coverage and Behat - Talking about code coverage in the case of Behat is not entirely appropriate, since it is not the specific code sections that are being tested, but the behavior of the application. However, coverage information may be useful, for example, before legacy code refactoring. The post shows how to organize the receipt of such information using Behat and PHP_CodeCoverage .
OOP in PHP - A huge and very detailed tutorial on basic concepts of object-oriented programming in PHP. It will be very useful for beginners.
Using Sphinx Search - A small introductory tutorial on Sphinx and quite a bit of integration with Yii.
Programming with Anthony - How to become an excellent developer - Slightly changing the format, one of the core PHP developers Anthony Ferrara continues a series of his programming videos. In this video, he answers the question: what should I do to improve my skills and become an excellent developer. Since it is impossible to know everything, then, in his opinion, it is better to learn to quickly understand the new than to memorize. Having received an interesting review on Reddit, Anthony decided to answer in the next video . The rest of the video from the series here
What I would like to see my first project on symfony - Good habrapost, in which the author shares his experience of using the framework and gives useful advice to those who are just starting to work with him.
Judy arrays in PHP - An excellent habrapost, a data structure that uses significantly less memory compared to the implementation of PHP built-in arrays, and therefore suitable for processing a significantly larger amount of data.
Good architecture is no excuse for wasting time - The author believes that Symfony2, despite its excellent architecture, is not a RAD framework , unlike Yii, CodeIgniter, CakePHP. That is, for 80% of tasks, using Symfony2 means wasting time on the implementation of simple things. But fortunately, good solutions exist: KnpRadBundle .