The second best thing about PHP 7

Following on from the previous theme I've picked out another of my favourite new things in PHP to talk about - general strictness. In current version of PHP there is no way to define the type of thing that a function will return or accept as a parameter - very different to most other languages.

The best thing about PHP 7

With PHP 7 finalised and almost here I thought I'd take a look and pick out a few of my favourite new features that it introduced. I do a lot of my daily work in PHP but do know a few other languages fairly well - there are some things being added that PHP has been lacking for a long time so, to me, this feels like a big catch up.

More realistic local web development server

One of the most common tools used to test and develop web projects is XAMPP. The idea is simple, you run a small web server on your local PC and use it to host a copy of the website you're working on. The problem with this is that it is not that similar to the environment that the site will actually run under, hosting companies very rarely use Windows for starters.

Concurrent processing in PHP

I occasionally run in to procedures that could really benefit from some form of concurrent processing. The most recent example was a script that created thumbnail images from a folder of large images but there have been many many others. Sometimes we're using a lower level language that is geared towards multi-threading, which is great. A lot of the time we've thrown together a quick script then later discovered it takes ages if one of the images is super high resolution.

Parsing maths in PHP

One of the interesting things about programming is that you sometimes come across a task that sounds really easy but is actually very difficult to implement for some technical reason.

Line breaks are friends not food

One of the things that never fails to make me want to repeatedly slam my head into my keyboard when looking at other peoples code is inconsistent or none existent white-space.

title_case() Function for PHP

A handy function to create a string for use as a title.