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 the next selection with links to news and materials.

    Enjoy reading!

    News and Releases

    Traditionally, on April 1, the Internet was shaking from side to side from the deafening "news". And the world of PHP is no exception. So, Yii2, which many are looking forward to, will be rewritten in Ruby . But what is Ruby! The already productive Phalcon PHP framework written in C will be rewritten in assembler . In addition, the PHP-FIG group was forced to admit that the decision to use spaces instead of tabs for indentation was not at all correct, and this time the tabs won! And of course, the most important thing was the “news” that the PHP project team decided to finally release PHP 6.0 instead of 5.5.

    • PHP 5.5 beta2 released - A little earlier than the planned date, the next beta was released, which means that there are chances to see a stable version in the spring. There are several bug fixes in the release, a full list of changes is here .
    • April issue of Web & PHP magazine - The following issues are covered in the latest issue: development of modern client-side components; Would you like to be a PHP evangelist ? the dark side of PHP and others.
    • Zend Framework 1 moves to Git - The framework code has been ported to GitHub . Zend Framework 1 is in the support phase, which will be suspended in a year and a half. Pull requests are accepted only for corrections, but does this mean that you can expect a fork of ZF1?


    • The comparison operators in PHP are very strange ... - In previous releases, Nikita Popov’s answer to StackOverflow about the intricacies of foreach was mentioned . This time Nikita answers the question about comparison operators. For example, the operator is ==not reflective, that is, it is $a == $anot always true.
    • Help, memory leaks in PHP! - Great slides from core developer and release manager PHP 5.5 Julien Pauli. A lot of useful information on how PHP is built from the inside.
    • Predicting random numbers in PHP is easier than you think! - A good post that details the methods for generating random values ​​in PHP and that these values ​​are not always “random”, as it might seem at first glance.
    • PHP is meant to die - In a post, the author says that PHP was never intended for long continuous execution. It is assumed that the script will complete the task in a short time and “die”. That is why PHP did not really care about memory leaks and other problems.


    Digests usually do not cover PHP podcasts, but the release of the new Zend podcast is a good reason to review all existing ones.

    • / dev / hell - A web development podcast, one of the authors of which is the notorious The Grumpy Programmer - the author of the same PHPUnit Cookbook .
    • PHP Town Hall - This podcast is created by two active developers from the 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 famous person from the PHP community and discuss relevant topics.
    • Lately in PHP - A video podcast authored by Manuel Lemos , creator of the PHP Classes resource . Actual news from the PHP world is discussed in a video chat with other PHP figures.
    • PHP Podcast - The very new Zend podcast created by Joe Stagner . In the first issue of the guest Cal Calans , the discussion is about the development of the PHP community.

    Learning Materials

    • The first look at React - React - is nothing more than an 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 an excellent report from the author of the library. In addition, some examples of simple applications in videos on the official React In Action channel .
    • Distributed PHP Applications Using Apache Zookeeper - A great introductory tutorial on using ZooKeeper . The author demonstrates the operation of a distributed application using a simple example.
    • Taming Slim 2.0 - A large and detailed tutorial on one of the recent PHP microframes .
    • Meet Boris: an improved REPL for PHP - Boris is a more advanced interactive programming environment compared to the built-in PHP, access to which, in turn, can be obtained by calling php -a. The link is a small tutorial that talks about installing, setting up the Boris library, as well as an example of using it 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. For testing, 3 types of applications were used: a large application on Zend Framework 1, a small PHP script, and WordPress. The result is quite expected: Nginx gives static quickly, but when it comes to generating pages using 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 should also be a collection." Or summarized: "The type of return values ​​must remain unchanged." And in the post he argues in favor of this rule.
    • Round table: using exceptions - The article is presented as a discussion of the topic by several developers. Each gives his arguments and examples. An interesting format and a lot of interesting thoughts.
    • PHP is not dead - In a post, the author writes about how the situation in the world of PHP has changed since 2007 . At that time, the fourth was the most popular version, and PHP5 was installed on less than 20% of the servers, and this despite the fact that she was already at least 2 years old! It would be interesting to look at the schedule for adopting the latest versions to understand how much the situation has improved, but the rest of the post contains only statistics on the use of PHP in general.
    • Sending email from PHP using Amazon SES - A small tutorial on using Amazon SES from PHP.
    • PHP 5.5 new password hashing API - This API has already been written more than once , and, nevertheless, another note with an overview of the added functions. And let me remind you, if you are not planning to use PHP 5.5 yet, you can use the password_compat compatibility library .
    • Support for multilingualism in CodeIgniter - A small tutorial on internationalizing an application written in CodeIgniter.
    • Code coverage and Behat - Talking about code coverage in the case of Behat is not entirely appropriate, since it is not some specific sections of code that are tested, but the behavior of the application. However, coverage information may be useful, for example, before refactoring a legacy code. 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 the basic concepts of object-oriented programming in PHP. It will be very useful for beginners.
    • Web application security and modern PHP frameworks - In a post, the author gives an overview of security changes over the past 2 years, namely with the release of ZF2 and Symfony2.
    • Zend Framework 2 Forms - Simple and Accessible Everywhere - A detailed tutorial on using forms from ZF2.
    • PHP Web Console - A small tool that can often be useful.
    • How to mess professionally - A useful note on how to behave if you make a mistake: admit, apologize and correct.
    • We create a voting application on Phalcon in 15 minutes - A good screencast for those who want to try Phalcon.
    • Using Sphinx Search - A small introductory tutorial on Sphinx and quite a bit about integration with Yii.
    • Programming with Anthony - How to become a great developer - Having changed the format a bit, one of the core PHP developers Anthony Ferrara continues a series of his programming videos. In this video, he answers the question: what should be done to improve your skills and become an excellent developer. Since it is impossible to know everything, in his opinion, it is better to learn to quickly understand new things than to remember. After receiving an interesting review on Reddit, Anthony decided to respond in the next video . Other videos from the series here
    • How I would like to see my first project on Symfony - Good hubrapost, in which the author shares his experience in using the framework and gives useful advice to those who are just starting to work with it.
    • Judy-arrays in PHP - An excellent hubrapp, about a data structure that uses significantly less memory compared to the array implementation built into PHP, which means it is suitable for processing a significantly larger amount of data.
    • The same application 4 times: PHP vs Python vs Ruby vs Clojure - The author of the post implemented a simple joke application in 4 different languages, not with the purpose of determining which is better, but rather just showing the differences. Enthusiasts also implemented Go, JavaScript, and Java versions.
    • Good architecture is not an 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 implementing simple things. But fortunately, a good solution exists: KnpRadBundle .

    Link to the previous issue.

    Also popular now: