A simple little trick in PHP for when you need to make sure that a value doesn’t drop below zero. For example, you might be subtracting a discount from a basket total and not want the amount to be paid to become negative.
Earlier today I got caught out by an interesting little issue when using
env() to access environment configurable values on a deployed Laravel app. Despite having read through the documentation I managed to completely miss the caveat on using this function whilst caching the app’s configuration.
Constants are named values that do not change. You’ve probably used them many times to set a value that you want to persist throughout your codebase. In this short post I’m going to look at a couple of ways we can use them to improve our code. We’ll look at how they can be used to reduce bugs and make our code more readable.
A look at automating NPM and Composer when checking out new branches and pulling from a remote Git repository using Git hooks.
A tutorial on getting started with PayPal’s REST API using PHP and MySQL I wrote recently for Evoluted’s Think Tank.
Visual Studio Code is hot stuff right now and is quickly becoming the editor of choice for developers worldwide. It’s available for Macs, Windows and Linux and best of all it’s free. These are what I consider the essential Visual Studio Code extensions for PHP developers to improve your productivity.
Introducing a simple Sublime Text package that generates Sublime project files for a directory.
An article on using Amazon’s AWS service for processing videos I recently put together for Evoluted’s Think Tank website.
A PHP question I particularly like to ask candidates at a job interview is to explain a bit of code that includes the
$$ syntax for variable variables. It’s great if the candidate is already familiar with this feature of PHP; but what’s more important to me is that once the candidate understands how this syntax works that they can describe potential issues with using it.