PHP Digest: PHP 5.3 — the Most Popular Version, Using PHP 5.5 New OPcache, Laracon Videos and Much More!
News and Releases:
- PHP 5.5.0 beta1 available — finally all disputes over the inclusion of Optimizer+ in PHP subsided. The development team introduced the first beta version, which includes OPCache (known before as Zend Optimizer+). Besides new array_column function was added as well as support for non-scalar Iterator keys was implemented in foreach. A full list of changes is available here. Also there is PHP 5.5 Upgrade instruction which includes a description of all the changes and a list of new features in PHP 5.5 with the links to the appropriate RFC. If you wish to help testing the latest version we recommend you to read this post. The release of the next beta is scheduled for April 4th, 2013.
- PHP 5.4.13 and PHP 5.3.23 released — a number of bugs are fixed, including gaps in security. A full list of changes is here.
- PHP 5.3 has become the most popular version — according to W3 Techs report, three and a half years after its release PHP 5.3 bypassed version 5.2 in popularity. While PHP 5.2 support was ended in 2010. And despite the fact that version 5.3 support will be ended because of PHP 5.5 upcoming release, a quite relevant version 5.4 is used by only 3% of websites. It was also noted in comments that according to Wordpress install stats PHP 5.2 is still the most common version used at 60+%. Let's see if something will change after version 5.5 release.
- Tricks of foreach technique in PHP — a post on StackOverflow that includes a great answer to some foreach peculiarities. Recommended reading for everyone.
- 26 ways to show that PHP can be even better — the author of the post gives a long list of features that are missing in PHP with the links to existing implementations.
- Introducing Array_column() in PHP 5.5 — the author of the post is the same author of the new array function itself. There is a brief history of the function (originally it was written for PHP 5.2) as well as some examples of its use.
- Implementing reusable fluent interface pattern in PHP with AOP — a great post that describes how to implement the Fluent Interface pattern (a la jQuery call chains) in Aspect-oriented style using Go! Aspect-oriented framework.
- Pick PHP requirements for packages responsibly — the author of this excellent post encourages package developers to be more responsible and not to specify (not to use) PHP 5.4 in the requirements, if short array syntax appears to be the only used possibility. Note that PHP 5.4 is more than just . Short array syntax will make your code just a little more readable, but it won't even surprise more than 90% of your users. Let the users of your package select the appropriate version themselves.
- New Relic for PHP: web application performance monitoring — New Relic continues its aggressive PR-campaign, so there is hardly a developer who hasn't heard about them yet. The post represents a small tutorial on how to use the service and provides its users with instructions for installing and configuring the necessary expansion on the server as well as the service overview.
- Extending an Iterator to make your code a little cleaner — a small post in which the author demonstrates an excellent idea – Iterator extension. Just have a look at the example provided by the author.
- Using PHP 5.5 New OPcache — a short note on how to start using opcode caching in PHP.
- PHP project management — despite of its title the post contains general and non-specific just for PHP recommendations on project management. In short: be iterative, be pleasant, be flexible and hope for the best.
- First serious attempts with PHPUnit, composer, and the Omniture API — in the post the author shares his experience with using Test Driven Development (TDD).
- Some thoughts on using array_* with closures — in the post the author argues in favor of using array_ * in closures and provides examples of sorting/ mapping / filtering.
- Ruling the swarm (of tests) with codeception — a good tutorial on how to use an excellent testing tool. The author recommends to use Codeception to coordinate all the tests as it can not only control PHPUnit and Selenium tests, but generate Code Coverage as well.
- Look, there are no databases here — the author of the post tells us about unit testing and the use of mock-object for PDO.
- 10 super useful PHP snippets you probably haven't seen — housekeeping tipping: small, but useful pieces of programming code.
- From Java to PHP — the author of the post welcomes those developers who decided to migrate from Java to PHP providing them with skilful advice and tips what to pay attention to when migrating.
- Pro Workflow in Laravel and Sublime Text — the post on how to streamline your workflow when building applications with Laravel framework using the Sublime Text editor. The given examples demonstrate creation of resources, work with Artisan commands and migrations.
- Practical aspects of the Adapter pattern — the author of the post briefly reveals the essence of the Adapter pattern as well as describes the main principles of its effective use. In addition there are examples of both good and bad uses of the pattern.
- Mocking with Phake — a tutorial that demonstrates the use of mock-objects in Phake. This unit testing tool appears to be different from PHPUnit Mock Objects and Mockery. More details on Phake are here.
- The Wheel: Symfony Console — a short overview of Symfony Console component with all its pros and cons.
- 5 reasons coding standards are essential — another post that describes the forced coding main principles.
- Integrate PHP application with Solr search engine — Sphinx appears to be one of the most popular solutions when choosing a search engine. Another possible solution could be Solr by Apache. The post represents a detailed user guide with examples on how to use Solr when implementing full text search. There is also a note on using Solr in Drupal.
- Always return something — in his first post the author was of opinion that the methods and functions in most cases shouldn't return a NULL value. After sharp criticism in comments the author admitted that he wasn't quite right and published another post. There he states that although there are many cases when NULL is a valid value to return, sometimes it happens that NULL value is returned when it should not.
- Sign-in with Twitter in a Silex application — the author of the post has implemented a simple component to authenticate via Twitter and gives an example of its use.
- Dater — a compact PHP library to standardize date-time formats in projects under development that is easily configured to different clients time zones. The main features of the library include the following: formats binding, locales support, native PHP DateTime class object init & formatting, time zones conversion, time zone auto-detection and others.
- Laracon videos — Laracon, the official Laravel conference was held recently. Three excellent video reports are available: History & Philosophy of Laravel, Better testing in Laravel 4 and complete analysis of request cycle in Laravel.
- Awesome PHP libraries — a long list of different libraries and utilities as well as various PHP resources for all occasions.
Read our web development and
business optimization guides
Compare in-house offshore
software developer payroll costs
Check the available resources for
a quick project start
Join our newsletter!
Get weekly updates of the top IT news delivered straight to your inbox