Remix.run Logo
▲ dofm an hour ago

A lot of people on old servers with old PHP are only ever going to risk the smallest upgrade they can, to avoid deprecation issues.

There's a deprecation in PHP 8.0 to do with the order of parameters with default values that will bite a lot of code.

In PHP 8.2, they deprecated creation of dynamic properties on classes without #[AllowDynamicProperties] pragmas or __get/__set accessors. That one also messes with a fair bit of code, though it's an easy enough thing for an LLM to just add that attribute to every class.

There's also the "left behind" tax: the older your server becomes through sheer complexity of upgrading, the more likely you are to have to compile PHP from source, which is not the nicest when you are likely to have to replace a distribution version that had a bunch of packages installed.

I was in this position for one machine for PHPShell; I had to build the patched 7.4. I happen to know that the deprecations in 8.2 will bite me, but the old project is going to get a more considerable overhaul sooner than that, so that it is in more LLM-friendly patterns.

Random side note: if you are revitalising an old PHP app and intend to migrate it away from PHP to another language, one sane intermediate step you might consider is reworking it to use the Slim framework ( https://www.slimframework.com ) which uses a compact form of route closure definition that is so similar to e.g. Express, Gin, the core Golang http.Handle APIs etc. that it will be a much easier task to scrutinise when you get there. LLMs seem positively giddy about the prospect. Type hints would help, too.

▲jasongi an hour ago | parent | next [-]

> lot of old PHP are only ever going to risk the smallest upgrade they can, to avoid deprecation issues in extremely old codebases.

This is becoming a rapidly dangerous mindset. The cost and risk of forking and fixing an abandoned piece of code is trending to zero and the risk of being pwned when leaving an EOL library publically exposed to the internet is trending to 100%.

Even the cost and risk of completely removing an unmaintained library is also trending to zero.

LLMs have a lot more patience for enumerating test-cases, automating tests and creating staging environments and magnitudes more than sysadmins have ever had.

The case for "don't touch it don't break it" is getting increasingly indefensible.

▲dofm 27 minutes ago | parent | next [-]

I don't disagree with any of this. But it is the case.

And you have to remember that a lot of this code is just not in reproducible environments. So there's a fair chunk of setup effort involved in even getting an LLM to be able to safely work on it.

Like I say, the "left behind" tax is a serious problem with this stuff.

▲Joel_Mckay 16 minutes ago | parent [-]

Most PHP/Python/Nodejs framework sites are auto-generated throw-away projects, that might run for 2 to 3 years at most.

Most people expect community-code PHP sites to fall apart eventually, as the people that deployed the host are usually already at another company years later.

Usually the fix is to spider a site into static html content, and nuke the dynamic rotting framework part from orbit. =3

▲LoganDark 30 minutes ago | parent | prev [-]

Not saying this is necessarily the case here, but you vastly underestimate just how enormously untested and fragile these legacy systems can be. Even an LLM can need a very skilled operator to succeed in such an environment.

These kinds of systems often not only rely on every possible bug, they can rely on every possible side channel as well. And they often don't have any sort of testing or staging environment where screwups are recoverable.

▲dofm 2 minutes ago | parent [-]

The problem is more the stuff that isn't fragile, has run well for a decade, and not been updated, perhaps because other things hold that back.

I have one of these apps. Good code, modular structure (but very bespoke, and much of it quite an old design pattern), has a dev environment (but that environment is also old), makes use of a few now quite old dependencies. Works really well, and as a freelancer I simply don't get the billable time to fix what "ain't broke", so it gets improvements as it gets new feature requests.

The problem is that it ain't broke, in fact. Nevertheless I fully know the IIABDFI days are gone.

I am recovering from severe burnout and untangling its dependencies, restructuring it into more modern architecture that will be more amenable to LLM management, but as with any serious legacy code there's a lot to deal with from several directions at once.

Even figuring out how to describe its architecture concisely to an LLM is a multi-phase project! It will be easier to semi-manually modernise some things so that there is less explaining to do.

As it happens, getting it to work on more recent PHP will be a much easier problem.

▲nullsanity 10 minutes ago | parent | prev | next [-]

[dead]

▲crown2 32 minutes ago | parent | prev [-]

> though it's an easy enough thing for an LLM to just add that attribute to every class.

why would you want to use a fascist automated plagiarism machine to do that when Rector can do it? this is madness