I'm writing PHP again... and I don't need that much help?!

2024-07-15 | Estimated reading time: 3 minutes

tl;dr: I picked up PHP again after ~20 years and it’s not that bad. The language and its ecosystem have improved a lot and having an IDE helped me apply what I know from other languages more easily.

After almost 20 years, I’ve been freelance-writing PHP for the last few weeks now… and I don’t hate it.

Sure, a big part of me not hating it may very well be that I’m writing Laravel-PHP instead of “plain PHP”, which I wrote from 2000 until 2006. Another very likely big reason is that I’m just a much better software developer now than I was 20 years ago. A lot of things just make more sense to me now than back then. My experience with Ruby on Rails definitely is pulling some weight, as well.

But I’m convinced that the many improvements in both the language itself, the tooling around it, and the development environments themselves are the real reasons why I don’t hate writing PHP in 2024.

I obviously like PHP classes and namespaces, but I’m somewhat indifferent about interfaces and the type system in general. I personally don’t hate proper typing, but it’s not necessarily something I absolutely want to have, either. I’m sure a lot more than that has changed since PHP 4, but those were the ones I’ve actively worked with and found noteworthy.

As for tooling… I don’t recall having any kind of tooling back then and I would always pick having Composer and PHPUnit over not having them.

For me though, who has the basic knowledge of how to write software – more specifically: web applications – and “just” needs help with applying that knowledge, having a proper IDE in PhpStorm paid off practically right away. I could have got even more help here by shelving out some money for a coding assistant like GitHub Copilot or JetBrains AI Assistant, but I’m not sure if I would be able to spot errors around some PHP-specific nuances, were they to show up in suggested code. Plus I’m still on the fence about how I feel about AI tools in general.

(Also, I’m sure I can be just as productive with VScode soon, but for the first steps, I don’t think I would’ve got as far as fast with VScode. I don’t know what I don’t know as a PHP developer, after all.)

Knowing how to phrase questions for a web search to find an answer that I can transfer over to solve my problem definitely helps, too. As much fire as the web has had to take for a long time now, it still is a lot more resourceful than it was in 2004.

At the end of the day, Laravel-PHP will just be another language I get to write for money. But I think I will have to step in the next time one of my friends rants about how horrible PHP is; it’s by far not the worst.

The one big major peeve I have though: Can I please have two different types for arrays as known in most other programming languages and those known as “associative arrays” in PHP?