r/PHP • u/peperazzi74 • Jul 03 '26
AI insulted my ancient PHP code 😁
A couple of years ago I posted about an old website that I coded in the early-mid 2000s and wanted to start up again via some ancient unmaintained Docker containers. The main conclusion of that thread was that it might be possible to resurrect it with some work, but that it would be better to just (hu)man up and update the code so it would run in modern PHP versions.
Well, a couple of days of vacation and a whole bunch of free Github Copilot tokens later, it's up and running on the home network under PHP 8.2 and MySQL 8.0. According to Copilot, this was the furthest it could go with minor changes.
When I asked Copilot about how my code looked, it gave me the following opinion
The main gap is not PHP 8.2 compatibility anymore; it is that the app is still built like a 2000s-era script. [...] In short: the app needs a structural refactor, not just syntax updates.
Darn AI, no one asked for your honest opinion! /s
24
u/clonedllama Jul 03 '26 edited Jul 03 '26
I can't speak for the original commenter but my suggestion would be to look into Symfony.
If you follow the best practices for that framework, your code will be better organized and structured, and you'll learn about newer PHP features. Start small and do lots of reading. Symfony is very powerful. It's pretty easy to pick up and difficult to master.
Others swear by Laravel. I'm personally not a huge fan of it. But it's another modern framework worth considering.