Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Rob Allen:
Simple Ansible file for Z-Ray preview
Sep 15, 2015 @ 10:12:07

For those wanting to check out the latest preview of the Zend Z-Ray stand-alone version, Rob Allen has posted a full Ansible script to help building the environment much easier.

Recently, Zend made available a Z-Ray Technology Preview which takes the Z-Ray feature of Zend Server and makes it stand-alone. This is very interesting as it means that I can run it with the PHP 5.6 on Ubuntu 14.04 LTS Vagrant set up that I prefer. I decided to create an Ansible playbook to install Z-Ray into my VM. The Z-Ray instructions are clear enough, so it was simply a case of converting them to a set of YAML steps as who wants to do manual installation nowadays?!

The configuration is set up to run on a Ubuntu machine with PHP 5.6 installed. It will download the Z-Ray plugin, extract it and copy over all necessary configuration files to get it up and running. This stand-alone version can help to make debugging your applications simpler with real-time information right in your browser.

tagged: zray preview standalone version ansible configuration ubuntu php56

Link: http://akrabat.com/simple-ansible-file-for-z-ray-preview/

PHP 7 Up and Running (Video Series)
Aug 28, 2015 @ 10:38:14

The Laracasts site has posted a set of videos that can help you learn all about PHP7 and get you up to speed before this next major release is available for download (well, a stable release anyway).

Slated for release in October, 2015, PHP 7 brings a wealth of new features, bug fixes, and performance improvements. If you're curious, come with me, as I demonstrate what's new!

The videos cover some of the major new features coming to the language including:

More videos are coming too, including one already listed showing how to use anonymous classes. Keep an eye on this series to learn all about PHP 7 before it's even released.

tagged: php7 video series introduction major version tutorial

Link: https://laracasts.com/series/php7-up-and-running

Symfony Blog:
Twig: How to upgrade to 2.0? Deprecation Notices to the Rescue
Aug 19, 2015 @ 10:55:58

The Symfony blog has posted a quick guide with a tip to upgrading to Twig 2.0 made simpler thanks to some built-in deprecation notices.

As Twig 2.0 is approaching fast now, it's time to focus on how to boost adoption of this new major version. [...] Also, the good news is that most of the time, it's possible to make your code work for both major versions (that's important for shared code like bundles). [...] How to make it easy? Like for Symfony, I've now added deprecation notices throughout the code to give Twig users an easy way to upgrade their code (this is available in the upcoming Twig 1.21 version).

The release of v1.21 comes with the deprecation notices already built-in making it easy to find the issues before making the jump up to v2.0. He also includes mentions of two other things included to make it easier: a deprecation collector to gather the issues in one place and a visitor base class diff that can make them compatible with both versions (1.21 and pre-1.21).

tagged: twig2 twig templating version upgrade deprecation notice

Link: http://symfony.com/blog/twig-how-to-upgrade-to-2-0-deprecation-notices-to-the-rescue

BitExpert Blog:
Running pdepend on PHP7
Aug 18, 2015 @ 09:57:19

On the BitExpert blog there's a post that shows you how to use the pdepend tool on PHP7, an automated tool that shows you the "quality of your design in the terms of extensibility, reusability and maintainability".

Being a good citizen of the PHP community we do test out internal libs against the current PHP7 codebase. So far we had no issues but then at one day one of our Jenkins PHP7 jobs failed. After investigating a bit it turned out that the problem was not part of our codebase but part of of pdepend. The pdepend process died with the error message that "T_CHARACTER and T_BAD_CHARACTER are no longer defined" which is true. The error was already reported as an issue on Github.

Unfortunately, as the problem here is a change to the core PHP language itself, there's not much of a workaround other than to just not run those certain jobs. He outlines how they handle detecting the tests that have problems, but only when run on PHP7. This allows them to run all of the tests and allow the automated system do to its work. When/if the problem is fixed in pdepend, all that's needed is to remove this one check and they're good to go.

tagged: pdepend phpdepend php7 skip test version error github issue

Link: https://blog.bitexpert.de/blog/running-pdepend-on-php7/

Andrew Smith:
Why is Slim 3 not so slim anymore
Aug 03, 2015 @ 09:54:13

In this post to is site Andrew Smith refutes the misconception that version three (v3) of the Slim PHP microframework is "not so slim" anymore with some of the additions to this latest version, increasing it's size and complexity.

There is a common misconception that Slim 3 has plenty of files and is no longer slim. Slim 3 does indeed contain more files than Slim 2 and this has been the result of being more flexible and moving away from the Not Invented Here (NIH) philosophy.

Installing Slim 3 through composer will install all its dependencies, when doing a PHP file count you will notice we have doubled in file count. This is a given with the amount of flexibility we now have. Most developers might not see any benefit in this as they will likely just work with what is provided, but if at any point you should hit a limitation in any working part of the framework, you can easily swap it out without a fuss.

He includes the command to install this latest version via Composer and how to count the number of files with a single command. He points out that some people that are reporting 1000+ PHP files being installed with the framework are probably getting the development packages as well and not just the release. He points out that "Slim 3 is still slim, we just added more flexibility in it." He ends the post with a thanks to Josh Lockhart and a few others who have made large contributions to the project and have helped make it what it is.

tagged: slimframework version slim3 slim2 size improvement flexibility

Link: http://thoughts.silentworks.co.uk/why-is-slim3-not-so-slim-anymore/

Community News:
PHP 7.0.0 Beta 2 Tagged
Jul 23, 2015 @ 08:45:27

According to this post on Reddit.com (and this NEWS file update) the latest beta of PHP 7.0.0, beta 2, has officially been tagged.

Fixes include updates in several different areas of the codebase:

  • Curl
  • GD (graphics handling)
  • Opcache
  • SOAP
  • the SPL (Standard PHP Library, with MutlitpleIterator)

You can find out more about all of the bugs that were fixed (including a sneak peek at what's coming in beta 3) in the NEWS file.

tagged: language php7 tag beta release version

Link: https://github.com/php/php-src/blob/master/NEWS

Release of PHP 5.4.43, 5.5.27 & 5.6.11
Jul 10, 2015 @ 09:35:17

As mentioned on the main PHP.net site today, three new versions of the language have been released to address various bugfix issues: PHP versions 5.4.43, 5.5.27 and 5.6.11.

The PHP development team announces the immediate availability of [these PHP versions]. Five security-related issues in PHP were fixed in this release, including CVE-2015-3152. All PHP 5.6 users are encouraged to upgrade to this version.

One note here too - 5.5.27 is the last official bugfix release according to the release calendar for that major version. Upgrading to PHP 5.6 is encouraged (the next supported version). As always you can grab these latest downloads from the main downloads page (or windows.php.net) and see the full list of changes in the Changelog for each version.

tagged: language version release bugfix v54 v55 v56

Link: http://php.net

Essential Macro Optimizations to Improve PHP Performance
Jul 09, 2015 @ 10:19:16

The Tideways.io blog has posted a set of four macro-optimizations you can do to help improve the overall performance of your application. Note the "macro" here, not "micro", so these are larger, more platform-level changes.

This blog post describes four macro-optimizations for PHP applications that are essential to consider before investigating other possible optimizations. [...] While its fun chasing after small micro optimizations, often it is debatable if the developer time is well spent. After all I/O is the more important bottleneck in almost every application. [...] But its much more efficient to fix the big issues first. The changes I present in this post can be done quickly and their gains can be massive.

The four suggestions he makes cover different areas of a standard application:

  • Upgrade PHP to a recent version
  • Use accelerator such as APC or OPCache
  • Close Session for Writes
  • Don't run XDebug in Production

Each tip comes with a bit of background on why it's a good idea and some have links to other resources supporting the change or update proposed.

tagged: macrooptimization performance application version opcode cache session write xdebug

Link: https://tideways.io/profiler/blog/essential-macro-optimizations-to-improve-php-performance

Cees-Jan Kiewiet:
Test lowest, current, and highest possible on Travis
Jul 01, 2015 @ 10:57:50

In a new post to his site Cees-Jan Kiewiet talking about "highest" and "lowest" versions of Composer-installed libraries and testing them in Travis-CI builds.

During DPC I've had a talk with Rafael about making sure you test all your possible versions, lowest, current, and highest. The talk was ignited by the infamous composer.lock file (whether to commit it or not).

He goes on to show how you can set up a multiple-version build with the help of the "dependencies" environment variable in your ".travis.yml" configuration file. These are then used in "before_script" commands that tell the Composer install which versions to load. He includes a screenshot of the resulting build and ends with a reminder from Jordi Boggiano (lead developer of Composer) about the resources a build like this takes up and not to do it very often.

tagged: lowest highest library version composer install travisci build

Link: http://blog.wyrihaximus.net/2015/06/test-lowest-current-and-highest-possible-on-travis/

PHP 7.0.0 Alpha 1 Released
Jun 12, 2015 @ 12:50:11

The first release on the path to PHP7 has officially been released according to this new post on the main PHP.net website - PHP 7.0.0 Alpha 1.

The PHP development team announces the immediate availability of PHP 7.0.0 Alpha 1. This release marks the beginning of the PHP 7 major series. All users of PHP are encouraged to test this version carefully, and report any bugs and incompatibilities in the bug tracking system. PHP 7.0.0 Alpha 1 comes with new version of the Zend Engine with features. [...] For more information on the new features and other changes, you can read the NEWS file or the or the UPGRADING file for a complete list of upgrading notes. These files can also be found in the release archive.

As with other alpha PHP releases, you can download this preview version from the downloads page or windows.php.net/qa website for the binaries.

tagged: php7 alpha1 release version download preview news upgrading

Link: http://php.net/archive/2015.php#id2015-06-11-3