The delicious evils of PHP

In a post on Sitepoint Christopher Pitt demonstrates some cool usages of eval and exec. I want to look at two PHP functions: eval and exec. They’re so often thrown under the sensible-developers-never-use-these bus that I sometimes wonder how many awesome applications we miss out on. Like every other function in the standard library, these […]

Continue reading →

Upgrading to PHP 7.1 is easy

PHP 7.1 was released last week. It has many nice new features. If you’re anything like me, you want to use the latest version right way. Upgrading to PHP 7.1 is not that difficult. Personally I use homebrew. The steps required to upgrade from 7.0 are laughably simple. Just issue this command in your terminal: […]

Continue reading →

Improving the performance of our PHP based crawler

Today a new major version of our homegrown crawler was released. The crawler is used to power our http-status-check, laravel-sitemap and laravel-link-checker packages. A new major feature is the greatly improved crawling speed. This was accomplished by leveraging multiple concurrent requests. Let’s take a look at the performance improvements gained by using concurrent requests. In […]

Continue reading →

Some request filtering macros

In a gist on GitHub Adam Wathan shares some macros that can be used to clean up a request. Allows you to trim things, lowercase things, whatever you want. Pass a callable or array of callables that each expect a single argument: Request::macro(‘filter’, function ($key, $filters) { return collect($filters)->reduce(function ($filtered, $filter) { return $filter($filtered); }, […]

Continue reading →

No Time for a Taxicab

Gary Hockin posted a video with his attempt in solving the Day 1 challenge of http://adventofcode.com/. The video not only shows how he solved the problem codewise but also demonstrates some nice features of PHPStorm. Mistakes and all, I attempt to code day 1 part 1 of the Advent of Code challenges you can find […]

Continue reading →

How I refactor to collections

Christopher Rumpel posted some good practical examples on how to refactor common loops to collections. Refactoring to Collections is a great book by Adam Wathan where he demonstrates, how you can avoid loops by using collections. It sounds great from the beginning, but you need to practice it, in order to be able to use […]

Continue reading →

What’s new in PHP 7.1

With PHP 7.1 scheduled to be released next week, it’s probably a good idea to go over the new features is offers. The newest version of PHP – 7.1.0 – is already at RC6 (Release Candidate 6) status, which means it will be out soon. After a huge update that took PHP from 5.6 straight […]

Continue reading →

PHP 7 is gaining ground fast

Jordi Boggiano shared some new stats on PHP version usage he collects via Packagist. A few observations: 5.3 and 5.4 at this point are gone as far as I am concerned! 5.5 still has a good presence but lost 12% in 6 months which is awesome. 5.6 basically stayed stable as I suspect people jumped […]

Continue reading →

PHP 7 at Tumblr

Another big boy on the web upgraded to PHP 7. If you’re not yet on the train heading for PHP7-ville, best get your ticket soon, you won’t regret it. At Tumblr, we’re always looking for new ways to improve the performance of the site. This means things like adding caching to heavily used codepaths, testing […]

Continue reading →

Some people to follow on Twitter

There are a lot of developers active on Twitter. Most of them tweet out interesting links, their opinions or stuff they’re working on. I think Twitter is an excellent tool to stay in touch with what’s going on in the Laravel and PHP community. If you’re looking for some people to follow here are some […]

Continue reading →

Bulgaria PHP Conference 2016 videos

The Bulgaria PHP conference organizers recently released videos of all the sessions of this years edition. https://vimeo.com/album/4217236 Freek Van der Herten Freek Van der Herten is a partner and developer at Spatie, an Antwerp based company that specializes in creating web apps with Laravel. After hours he writes about modern PHP and Laravel on this […]

Continue reading →

A magic memoization function

Last friday Taylor Otwell tweeted an easy to use memoization function called once: Wanted a slick way to generalize class method memoization. Y'all don't even want to know how it works. 😈 🤘 pic.twitter.com/xRJAY1C14y — Taylor Otwell (@taylorotwell) November 4, 2016 Taylor was kind enough to share the source code behind the function. Because I’d […]

Continue reading →

Structuring PHP exceptions

Alain Schlesser wrote an article on how to manage exceptions in a large codebase. I seem to constantly work on improving my habits regarding the use of exceptions. I think it is an area that I haven’t yet fully explored, and it is very difficult to find anything more than very basic explanations and tutorials […]

Continue reading →

What’s in store for PHP performance?

Jani Tarvainen explains where PHP is heading performance-wise. PHP 7.0 was a leap in performance that came with very easy adoption. Simply verify compatibility with the version and upgrade your server environment. Speeding up many older architecture apps like WordPress and Mediawiki by a factor of two is a testament to backwards compatibility. In 7.1, […]

Continue reading →