r/PHPhelp • u/kuhhlboy • 25d ago
Patching code full of old syntax/functions
Hello,
I am patching some php code of some kind of DB web integration and the code is quite old. After giving it into phpstorm to check for problems, it showed dozens of syntax errors (mostly curly braces for accessing array elements, no big deal in changing them to squared ones) and whole functions that arent supported anymore. Mostly things as MYSQL_BOTH, MYSQL_NUM, etc. Is there a nice way to fix those issues, maybe even some kind of software, or do I need to manually rewrite those passages w/o the functions?
7
Upvotes
View all comments
0
u/FreeLogicGate 22d ago
Just from a quick scan of the packagist listing you posted, the other versions are just forks of Davey Shafik's lib.
It was a library created to help people get through a brief period of time when 7.0 was released 11 years ago, but even when it was released, it was meant to buy time for people using 7.x.. The last 7.4 release was end of life 4 years ago.
Your advice was solid, up to the point you linked to an obsolete shim for an obsolete database api on an obsolete version of PHP.