Abstract Upon migrating to a new infrastructure we started experiencing cache issues after each deploy: as we refreshed pages that were updated by the new release, we didn’t see the right content for a very short period of time. Initially, we wrongly assumed that the cause of this issue was the PHP OPcache extension but, after our investigation, we understood that real path cache was the culprit. Introduction When I started my software developer career, I was very surprised to read the following sentence, attributed to Phil Karlton: «There are only two hard things in Computer Science: cache invalidation and naming things».
Articles in category: PHP
In the latest months I wrote multiple times, in different projects, code migrating PHPUnit toward major version 6. This upgrade is harder than the previous one, since in this version it was introduced a big breaking change: all classes got (finally!) namespaced. This means that any usage of those classes in your project needs to be updated. It may seem a simple find & replace job, but since you need to introduce at least one use PHPUnit\Framework\TestCase line at the top of each one of your test classes, it’s a boring and a little more than trivial task; also, upgrading it in a single big jump may not be feasible or prudent, especially in the case of open source or distributed libraries, where backward compatibility and support for old PHP versions must be ensured.
A few days ago I stumbled on a strange tweet that was highlighting a controversy about scalar type hints. Scalar type hints & return types vs no scalar type hints & return types is #PHP's new spaces vs tabs — Cees-Jan 🔊 Kiewiet (@WyriHaximus) 19 maggio 2017 After asking references about this, someone alluded to this very short video: “PHP Bits: Visual Debt” (it’s only 3 minutes, please watch it before continue reading).
Like clockwork, on May we head up to Verona to attend the phpDay conference; this time it was on May 12th and 13th. We met a lot of new people and known fellow PHP developers, and like previous years, we wanted to write down a light summary; like the previous ones, this won’t be a full “review” of the conference, but an highlight of the talks that captured most of our attention, or what we found more valuable for our everyday work.
The enemies of programming As many of you will agree with me, sleep deprivation is the enemy of programming. Maybe we fear only one thing more than that: being interrupted. While writing code we have to think really hard, we use complex abstractions, we go through long business workflows and so on… fatigue and interruptions are the main enemies of those in this line of work. My experience On my day job, I do all this mental juggling on a pretty big project, which is based on PHP 5.5, Symfony 2.8, Doctrine etc.; luckily, in this project we use a good deal of good practices, and automated software testing is one of those.