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!

October 20, 2016

Welcome to all you lovely people out there in the PHP community.

We start with several releases from the PHP development team this week, including the 4th release candidate for PHP 7.1.0, as well as 5.6.27 and 7.0.12.

We also have the second part of the series on PDO for Beginners, this time looking at how to make PDO prepared statements.

Anna Filina talks about her experiences with Yahoo's password security.

Plus That Podcast makes a welcome return this month, with the guys updating us on what they've been up to since we last heard from them.

And finally, the Call for Papers has just opened  for the Midwest PHP Conference, taking place in March of next year. Tickets will go on sale soon, so save the date!

Have a great weekend,

Katie and Ade

We love our sponsors. Why not try them?

 From our sponsors:
Turn Errors into Awesome Quickly pinpoint what’s broken and why. Get the context and insights to defeat all application errors.

(ads by LaunchBit) 


Yahoo!’s Password Security
I posted this tweet recently and got many replies. Since I was answering the exact same few questions dozens of times, I’d like to summarise everything here. I will also add some new information that I gathered that will clear many things up.

Notable PHP Package: PHP Safe Image Preview
Some sites need to receive images from users that may not be safe for displaying to non-adults. In this case it may be better to avoid showing those images to children. However, when you don't know if the user is not an adult, it would be better to show an obfuscated version of the image. This class can use an API to determine if an image is not safe for showing to non-adults. It can also return a blurred version when it is the case, thus avoid showing the image explicitly. Read this article to learn more details about how this notable PHP package works.

Why PHP and Symfony, And Not Java?
We are often asked, especially by our enterprise customers at financial institutions, why we decided to go with PHP and Symfony instead of a Java framework.  And, as we have actually re-considered alternatives both in 2007 and 2011, we know the answer pretty well. We also know first hand how much PHP and the PHP ecosystem has matured and progressed in the last few years, how Symfony2 and Composer provided a big jump forward, how PHP v7 and Symfony3 is positioned to provide the next, in the end making us very confident in our choice and in recommending it to others. Read-on if you're interested in the topic!

Taking PHP Seriously
Slack uses PHP for most of its server-side application logic, which is an unusual choice these days. Why did we choose to build a new project in this language? Should you?

Tutorials and Talks

Picking the Brains of Your Customers with Microsoft’s Text Analytics
With the explosion of machine learning services in recent years, it has become easier than ever for developers to create “smart apps”. In this article, I’ll introduce you to Microsoft’s offering for providing machine-learning capabilities to apps. Specifically, you’ll learn about the Text Analytics API and build an app to enhance the understanding of online sellers when it comes to their customers.

A Better dd() For Your TDD
An important part of every Laravel developer's debugging arsenal is the humble dd() helper function—"dump and die"—to output the contents of a variable and terminate execution of your code. In the browser, dd() results in a structured, easy-to-read tree, complete with little arrow buttons that can be clicked to expand or hide children of nested structures. In the terminal, however, it's a different story.

Utilising Composer's Classloader to Locate a Class
Composer and Packagist have fundamentally changed the PHP package landscape by providing a central package registry, plus a tool to easily install packages listed in that registry and autoload them using PSR-04. But the composer tooling can be used for more then just installing and autoloading files. We'll explore one of them in this post.

6 Good Practices For ‘use’ in PHP
While reviewing code recently, I realised there are no guidelines for use. Every modern code do use ‘use’ (sic), as importing classes from composer or a framework is the norm. There are now quite a few variations in syntax for importing classes or traits. Although the impact on performance is low, as use is solved out, having a clean approach to ‘use’ is important to keep the code clean and readable. Let’s review what are the six good usage of use.

Replacing Mocks with Spies
Mock objects are useful when verifying that a method was called is more important than verifying the outcome of calling that method.

Building Your Startup With PHP: Email Commands
This tutorial is part of the Building Your Startup With PHP series on Envato Tuts+. In this series, I'm guiding you through launching a startup from concept to reality, using my Meeting Planner app as a real-life example. In the last tutorial, we began emailing meeting invitations which included numerous links for participants to respond, i.e. view the meeting page, accept all places and times, reject a place or time, etc. In this tutorial, I'll review how I chose to construct and process those links in a secure, functional manner. 

PDO For Beginners Part 2
In Part 1 of the PDO tutorial, we saved data in our database directly using PDO. This is not ideal for security, however, as it can get affected by SQL injections. To save our data from SQL injections we use prepared statements in MySQLi and PDO. In this part, we are going to learn how to make PDO prepared statements.

A First Look at Atlas – the ORM That Delivers
A Data Mapper moves data between objects and a database, and isolates them from one another. With a Data Mapper, the in memory objects don’t even need to know that a database exists. AtlasORM is a data mapper implementation for your persistence model (not your domain model). 

When Are Single-Character Variable Names Acceptable?
There is a simple (but unsatisfying) answer to all questions of this form: they are acceptable when they would make the code clearer. This can happen in a few ways. The most common, as you noted, is convention: i, j, k for loop variables, x and y for coordinates, e for exceptions, f and g for functions and so on. Another is structure. Often, the broad structure of an expression is more important than its contents. Using shorter variable names makes it easier to read at a glance. I think this is often more important than being easy to read in detail! 

Laravel Blade SVG Directive
Using SVGs in your design is all the rage and for good reason. They can be resized to any size without becoming pixelated, you can reference them by id, modify them through CSS or JavaScript. One of the difficulties in using SVG files in your templates is referencing them. Currently, there are three ways this can be done. Either referencing an SVG file, embedding the whole thing, or use an SVG sprite. Here is how the different styles look when written in HTML.

A Class to Parse, Build and Manipulate URLs
For several projects and other packages we need to manipulate URLs. Instead of coding the same URL class over and over again, we extracted URL manipulation to it’s own package. Here are some code examples on how you can use it.
News and Announcements

PHP 7.1.0 Release Candidate 4 Released
The PHP development team announces the immediate availability of PHP 7.1.0 Release Candidate 4. This release is the fourth release candidate for 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.

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

PHP 7.0.12 Released
The PHP development team announces the immediate availability of PHP 7.0.12. 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.

Join Us Again for Global WordPress Translation Day
The WordPress Polyglots team is organising the second Global WordPress Translation Day on November 12th. Everyone is invited to join – from anywhere in the world!

True North PHP Conference - 3rd-5th November 2016, Toronto
The 2016 edition of TrueNorthPHP will be the last, as the organisers are moving on to other activities.Three days of learning things you didn't know about PHP and complementary technologies. You'll also get the chance to meet and talk with some of the PHP community's best-known speakers and contributors. Please join us on November 3-5, 2016 as we will go out on top with an awesome conference! Tickets are on sale now.

PHP Benelux Conference - January 27-28th 2017, Antwerp
The conference and tutorials will take place at Hotel Ter Elst in Antwerp (Belgium). Friday morning January 27th we have a set of tutorials. The conference is spread over 2 days: Friday afternoon (after the tutorials) and Saturday. Tutorials as well as the conference itself are spread over several parallel tracks. On Friday and Saturday evening, we’re having the conference social. This will include drinks and all the cool side activities. Save The Date, tickets go on sale soon.

Midwest PHP Conference - March 17-18th 2017, Minnesota
Midwest PHP is the FUN conference. This is our fifth annual conference, and each year it gets better and better. Our goal is to share best practices, ideas, and techniques about building state-of-the-art software applications. The Call for Papers is now open.


Lately in PHP Podcast Episode 76 - PHP 8 Performance To Be Boosted with a JIT Engine 
Recently, Dmitry Stogov of Zend announced that he is restarting the work on the JIT engine that eventually will boost the performance of PHP 8. This great news was one of the main topics discussed by Manuel Lemos and Johnny Mast in Episode 76 of the Lately in PHP podcast, now also being streamed using In this episode they also commented on new proposals for PHP, like having both PHP 5 and PHP 7 builds running on the same Web server, single entry PHP apps for reducing the overhead of application bootstrap code, type strict comparisons, built-in request and response objects in PHP, among other topics.

Voices of the ElePHPant - Interview with Katie McLaughlin
Recorded at PHP Tek 2016 earlier in the year, Cal Evans talks to software developer and open source enthusiast Katie McLaughlin.

Laravel IO Podcast - Episode 49: Big Ball Of Yarn
In this episode, the crew discusses PHP 7.1, Laravel Forge, Yarn, Validator improvements, and more.

That Podcast Episode 32: Revival
Beau and Dave are back. Beau is back in the states. Dave has nothing interesting to report. We talk a little about what we've been up to and touch on getting started doing conference talks.

Full Stack Radio Podcast Episode 52: Taylor Otwell - Patterns for Simplifying Laravel Applications
In this episode, Adam and Taylor Otwell have a discussion about strategies they use to write cleaner, simpler code when working with the Laravel framework.

Acquia Podcast: Nothing About Us Without Us - Diversity of the Web with Nikki Stevens
Following her inspiring keynote on diversity, inclusion, and equality at Drupal Camp Costa Rica 2016, I got the chance to speak with Nikki Stevens in front of my mic and camera. Along with sharing some fun Drupal memories, like the time young Nikki broke production when Steve Rude was out for the day, a lot of this conversation is about the benefits diversity brings and how we all can improve our own organisations and communities.

MageTalk Magento Podcast #102 - You Say “Hey I Want a Pizza” and They Bring You a Pizza
Kalen grills Phillip on his new podcast and asks "what exactly is conversational commerce?

Laravel News Podcast LN28: Laravel 5.3.18, Yarn, Leanpub, and more
In this episode, we discuss Yarn, Facebook's new JavaScript package manger, the new Laravel Links section, and lots of other random topics. This is our last podcast episode for 2016 and we will be taking a break until next year.

The Laracasts Snippets Episode 45: Beware The Mob
We're all aware of the notorious Twitter mob. Don't you dare go against agreed upon opinions, or you will be sliced to pieces. We've seen the wake of these viral slander campaigns countless times over the years - all the way up to the creator of JavaScript, himself. Why are we okay with this again? And are we creating an environment that encourages any person with differing views to remain silent, out of fear of losing their job?

Reading and Viewing

How I Open Sourced My Way to My Dream Job: Mohamed Said
Mohamed Said got his first computer at age 13 - they were just becoming commonly accessible in Egypt - and started learning to code almost immediately. Last month, he became the first full-time hire at Laravel, the open source PHP framework built by Taylor Otwell.

An Exclusive Interview with Matt Stauffer
Matt Stauffer is a Partner and Technical Director at Tighten Co., a consultancy company that partners with non-profit and businesses to help them develop software for their brilliant ideas. Matt attends and speaks at numerous conferences and loves to talk and blog about development. Here, he talks to Cloudways about how he started his career in PHP programming, his preferred PHP framework, and a lot more.

Modular Programming with PHP 7 Kindle Edition (by Branko Ajzele, 9th September 2016)
This book demonstrates code reusability and distributed development to get high speed, maintainable, and fast applications. It illustrates the development of a complete modular application developed using PHP7 in detail, and provides a high-level overview of the Symfony framework, a set of tools and a development methodology that are needed to build a modular web shop application.

Domain-Driven Design in PHP (by Carlos Buenosvinos, Christian Soronellas and Keyvan Akbary, published 18th Sep 2016)
Learn how to correctly design Entities, Value Objects, Services, Domain Events, Aggregates, Factories, Repositories and Application Services with PHP. Explore applying the Hexagonal Architecture within your application, whether within an open source framework or your own bespoke system. Finally, look into integrating Bounded Contexts, using REST and Messaging approaches.


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

Edge is a high performance, lightweight MVC framework, for PHP 5.4 or later.

PHP implementation of HUSL (revision 4).

The Basecamp SDK for PHP enables PHP developers to easily integrate 37signals Basecamp all new API into their applications.

The library provides a Office 365 REST client for PHP applications. It allows to performs CRUD operations against Office 365 resources via an REST/OData based API.

The Recurly PHP Client library is an open source library to interact with Recurly's subscription management from your PHP website.
A home for all PHP-related usergroups.

A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!

A simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework.

Open source e-commerce solution for PHP, based on the Symfony2 framework.

A PHP client for the Ticket Evolution web services.

PHP rapid application development framework.

A fast, simple, extensible framework for PHP. Flight enables you to quickly and easily build RESTful web applications.
Please help us by clicking to our sponsor:

 From our sponsors:
Turn Errors into Awesome Quickly pinpoint what’s broken and why. Get the context and insights to defeat all application errors.

(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 ©