Subscribe! Enter your email address below:

NO SPAM: We absolutely hate spam. We will not share, rent, or give away your email address to anyone.You can unsubscribe at any time. Easily!

June 30, 2016

Welcome to the latest round-up of all things PHP!

The PHP development team has announced several releases this week, including 7.0.8, 5.6.23, 5.5.37 and 7.1.0 Alpha 2. All are available immediately.

Also this week, the latest step towards creating an actual PHP Rainbow ElePHPant sees a prototype made in China.

We take a look at test double framework Prophecy.

Plus we have a lightning talk on effectively managing your time and avoiding distractions to your productivity.

And finally, the PHP Town Hall podcast team is back with an all-star episode, including guests Anthony Ferrara, Woody Gilk and Beau Simensen.

Enjoy your weekend folks, 

Ade and Katie

We love our sponsors. Why not try them?

From our sponsors:

SourceGuardian 25% Exclusively to PHP Weekly readers, we have an offer on SourceGuardian, up until the end of July2016 (was June 2016, but its been extended), to receive 25% off the purchase price of SourceGuardian. Protect your PHP code. Download the free trial and use the following discount code: bldcvzrh0FIw5AoY


Musings of a PHPDiversity Rainbow Elephpant
Mark’s away at the Dutch PHP Conference where (apparently) he’s talking to people about cats; but while he’s away, I’ve had the most incredible, incredible news. It’s really been a very busy day here.

Writing Good Code: How to Reduce The Cognitive Load of Your Code
Low bug count, good performance, easy modification. Good code is high-impact, and is perhaps the main reason behind the existence of the proverbial 10x developer. And yet, despite it’s importance, it eludes new developers. Literature on the subject usually amounts to disconnected collections of tips. How can a new developer just memorise all that stuff? “Code Complete“, the greatest exponent in this matter, is 960 pages long! I believe it’s possible to construct a simple mental framework that can be used with any language or library and which will lead to good quality code by default. There are five main concepts I will talk about here. Keep them in mind and writing good code should be a breeze.

Tutorials and Talks

How To Create A Simple, Functional Contact Form Using Yii2
In the previous article on Yii2, we created a hello page and call it using the controller. In this tutorial, I will create a database with a table which will save the contact form data, and connect the database to the Yii2 application.

Laravel Doctrine – Best of Both Worlds?
Laravel Doctrine is a drop-in implementation of the famous ORM for the Laravel 5.X Framework, and a really interesting alternative to the default choice, Eloquent. In this article, we will learn how to use it, and when.

PHP w/ NGINX on Ubuntu
In this tutorial we will discuss deploying PHP web content that will be served via NGINX running on an Ubuntu server.

Create a 'Conversation' Banner With Revolving Text in WordPress: Part 2
In this set of two tutorials, we're creating a slider to display posts from a custom post type in such a way as to create a conversation effect between two speakers in an image. In the previous part, we registered the post type, set up the sliders and added them to our site header. Now we need to position the text and add styling.

The new $loop variable in Laravel 5.3
Laravel's Blade templating language provides something called "directives", which are custom tags—often control structures—that are prefaced with @. If you've ever written templates with Blade, you're likely familiar with @if, @foreach, and so on. In 5.3, the @foreach directive is getting a bit of a superpower, in the form of a new $loop variable that will be available inside every @foreach loop.

For a while now I have been using Mockery as my test double framework of choice, however recently I have been taking a look at Prophecy as an alternative. Using Prophecy inside our tests is actually very easy, and one of the main selling points of the framework is that the intent is very clear since the API is so clean, the steps involved are.

Easily Test Email with MailThief
MailThief is a new package by Tighten Co. that provides a fake mailer for your Laravel application. This makes it easy to test email without actually sending any. To better explain how this package works take a look at the following example from the project.

Cache Enhancements in Symfony 3.1 and 3.2: PSR-6 and Tag Invalidation
It's been said that there are only two hard things in Computer Science: cache invalidation and naming things. It seems that this statement from Phil Karlton continues to be true. Naming things is as close as code can be to poetry, so I'll leave that for the philosophers to discuss.

Your Own Custom Annotations – More than Just Comments!
In this article, we are going to look at how we can create and use our own custom annotations in a Symfony 3 application. You know annotations right? They are the docblock metadata/configuration we see above classes, methods and properties. You’ve most likely seen them used to declare Controller routes (@Route()) and Doctrine ORM mappings (@ORM()), or even to control access to various classes and methods in packages like Rauth. But have you ever wondered how can you use them yourself? How you can define your own annotation and then use it to read information about a class or method without actually loading it?

PHP Generators – A Guide and Tutorial
In my in-depth guide about iterators I talked about what iterators are exactly and how you can use them. At the end I told you that I’ll also write one for generators. Here it is.

Dispatch REST-like Requests with a Single Controller Class in Zend Expressive
I was digging into Zend Expressive and how to use controllers that allow me to share dependencies between different routes, instead of having to use different middlewares every time. This is a perfect approach that easily allows you to reuse some code, but then I thought how to do something similar in a rest environment, having a single class with different dispatchable methods that will be called depending on the request's HTTP method. This is a possible solution based on ZF2's AbstractRestfulController.
News and Announcements

PHP 7.0.8 Released
The PHP development team announces the immediate availability of PHP 7.0.8. This is a security release. Several security bugs were fixed in this release. All PHP 7.0 users are encouraged to upgrade to this version.

PHP 5.6.23 is released
The PHP development team announces the immediate availability of PHP 5.6.23. Several bugs were fixed in this release, including security-related ones. All PHP 5.6 users are encouraged to upgrade to this version.

PHP 5.5.37 is released
The PHP development team announces the immediate availability of PHP 5.5.37. This is a security release, several security bugs were fixed. All PHP 5.5 users are encouraged to upgrade to this version.

PHP 7.1.0 Alpha 2 Released
The PHP development team announces the immediate availability of PHP 7.1.0 Alpha 2. This is the second alpha release for PHP 7.1.0. All users of PHP are encouraged to test this version carefully, and report any bugs and incompatibilities in the bug tracking system. THIS IS A DEVELOPMENT PREVIEW - DO NOT USE IT IN PRODUCTION!

Laravel 5.3 Will Be Released at Laracon US
It was announced this week that Laravel 5.3 will be officially released at this years Laracon US conference. This means it’ll be out either July 28th or the 29th.

Northeast PHP Conference - August 4-5th 2016, Canada
The Northeast PHP Conference is a community conference intended for networking and collaboration in the developer community. While grounded in PHP, the Northeast PHP Conference is not just about PHP. As the organisers know, most PHP developers are working on websites and applications, which means that they need more than just PHP skills to get ahead. The additional Web Technology and User Experience topics help these developers broaden their skill sets and expand their knowledge & experience. Tickets are on sale now.

PHP Conference Asia - 22nd-24th August 2016, Singapore 
The second pan-Asian PHP conference will take place between 22nd and 24th August 2016 in Singapore - the Garden City of the East! Monday, 22nd August 2016 will be a Tutorial day, followed by two days of Conference. Come and meet with the fastest growing PHP communities in Asia. More than 300 attendees are expected in this single track conference. Tickets are on sale now.

WeCamp - 23rd-27th August 2016, Island De Kluut, Biddinghuizen NL
WeCamp 2016 is 5-day coding retreat on a private island. You will be teamed up with 4 others and a personal coach to create fantastic software. In five days time, you will go from a new software concept to the working product and experience all stages of the process. Only a handful of tickets are left, on sale now.


PHP and JavaScript Innovation Award Report June 2016 Edition - March 2016 nominees
This is the June edition of the Innovation Award podcast hangout recorded by Manuel Lemos and Arturs Sosins to comment on the outstanding features of all the past month nominees and winners PHP and JavaScript packages, and the prizes that the authors earned, starting with the nominees from the month of March 2016.

PHP Town Hall Podcast Episode #50: Low Down on PSR-15 
An all star cast this episode, as Ben and Phil are joined by regular guest Anthony Ferrara - thinker of good ideas and long-time part-time side-line contributor to the PHP-FIG, Woody Gilk - one-speed rider & BDFL of Kohana, and Beau Simensen - author of a bunch of stuff including StackPHP.

Voices of the ElePHPant - Interview with Brett Florio
This week Cal Evans talks to co-founder of FoxyCart Brett Florio.

Three Devs and a Maybe Podcast - Caching up with Joe Watkins
In this weeks episode we are lucky to be joined by Joe Watkins. We start off the discussion around the development of PHP 7.1 and the recent initial alpha release. Following this, we give an update on a couple of previously mentioned RFC’s, along with how Joe’s ones are doing. This leads us on to highlight how some small proposed changes are paving the way to optimal machine-code and finally integration of a JIT compiler. Some of these proposed changes may result in backwards compatibility breaks, we discuss this topic and when it is deemed acceptable to permit this. Finally, we chat about memorisation, caching and how it is not really feasible to distill a standard caching interface that fits all requirements.

Sound of Symfony Podcast: Episode 14 - What's new in Symfony 3.1
The band is back together and this time it's a blast from the past. We revisit the old news segment and do a whole show featuring nothing but news. We're talking Symfony 3.1, PHP 7.1 and the fall conference season.

PHP Round Table Podcast Episode 48 - Docker and PHP
The demand for DevOps skills is growing more and more in modern web development. But all the hype and demand is met with myriad DevOps tools. Staying abreast of how these tools can help make our jobs easier can be daunting. So today we take a closer look at one of these tools called Docker which takes a microservices-architecture approach to managing your servers.

Laravel News Podcast LN20: With special guest Adam Wathan
In this week’s Laravel News podcast we have Adam Wathan on to talk about his book Refactoring to Collections and a new package MailThief.

The Laracasts Snippets Episode 30 - You Will Figure It Out. Every Time.
If I were to pick my most favourite aspect of programming, it's this: no matter how difficult or confusing a bug/feature/refactor may be, if you stick with it long enough, you will figure it out. Every single time.

Reading and Viewing

DNS For Developers
Maarten Balliauw explained the ins and outs of DNS at this year’s NDC in Oslo.

Jenny Wong - From PHP to WordPress
Jenny Wong is a community engineer at Human Made. I’ve known Jenny for a while and on June 4th 2016 I interviewed her at the very first WordCamp Antwerp. Good times!

Ben Gillbanks Talks About WordPress Theme Development
Ben Gillbanks is the Owner, Developer, and general dogs body at Pro Theme Design. Previously, he had lead the web development team and worked on a series of projects helping to shape the future direction of the company itself. He is well known for WordPress, Photoshop, Graphic Design, Game Development, Basic PHP, MYSQL, and Videos Games.

< ?php echo “Hello Worl…Ooo Shiny! (Tips on time management and avoiding distractions.)
Being productive is all about being in the zone. There are many distractions from that goal, both internal and external. This talk will give you several tips and tricks of the trade to avoid those distractions that are avoidable and tactics to mitigate the effects of those that are unavoidable. Some of the concepts Sean will touch on include: remote working, co-working, office hours, meeting schedules, the fear of success and the fear of failure.

Top 4 Mistakes Developers Should Avoid when Creating Their Own Software Product Business
Many developers try to create their own business based on software that they develop but some fail, often due to the same mistakes that others already committed. If those developers knew in advance what are those mistakes, they could have avoided failing, simply by not repeating the same mistakes. Watch this short video to learn what are the top mistakes that you should avoid when you try to create your own software product business.

PHP and MySQL Recipes: A Problem-Solution Approach Paperback (by Frank M. Kromann, published 11th Jun 2016)
This book is a source of instant solutions, including countless pieces of useful code that you can copy and paste into your own applications, giving you answers fast and saving you hours of coding time. You can also use this book as a reference to the most important aspects of the latest PHP scripting language, including the vital functions you know and love from previous versions of PHP, as well as the functions introduced in PHP 7.


Do you have a position that you would like to fill? PHP Weekly is ideal for targeting developers and the cost is only $50/week for an advert.  Please let me know if you are interested by emailing me at [email protected]

Interesting Projects, Tools and Libraries

A lightweight and fast template engine for PHP.

A small, speedy database abstraction layer for PHP.

Event driven BDD test framework for PHP 5.4+.

The PHP client library for the Recurly API.

A PHP library containing a set of common functionality.

Assetic replacement based on the gulp build tool.

Syrup is a framework for rapid development of Keboola Connection components (i.e. extractors). It is based on Symfony2 framework.

BDD test framework for PHP, inspired by Jasmine and RSpec. Features a familiar syntax, and a watch command to automatically re-run specs during development.

Surikat is a Full Stack Framework for Web Development.

Sage is a WordPress starter theme based on HTML5 Boilerplate, gulp, Bower, and Bootstrap, that will help you make better themes.

Zerg is a small PHP tool that allows you to simply parse structured binary files like lsdj memory dump file, jpeg encoded image or your custom binary format file.

Silly CLI micro-framework based on Symfony Console.
Please help us by clicking to our sponsor:

 From our sponsors:
Find Your Top Developers See why top startups depend on Toptal to connect them with elite designers, hand-picked to match their needs. Work with top designers on an on-demand basis.

(ads by LaunchBit) 

So, how did you like this issue?

Like us on FacebookFollow us on Twitter
We are still trying to grow our list. If you find PHP Weekly useful please tweet about us! Thanks.
Also, if you have a site or blog related to PHP then please link through to our site.

unsubscribe from this list | update subscription preferences 

Protect your PHP code with SourceGuardian 10. Free trial.


Subscribe! Enter your email address below:

NO SPAM: We absolutely hate spam. We will not share, rent, or give away your email address to anyone.You can unsubscribe at any time. Easily!

Talk to us!

If you have some news, want to share a link with us or chat with us feel free to email us.

And we also have an RSS feed that you can use.

Like us on FacebookFollow us on Twitter

Copyright ©