r/PHPhelp • u/kuhhlboy • 26d 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?
8
Upvotes
View all comments
3
u/Tomas_Votruba 26d ago edited 25d ago
Rector + agents are able to handle this in ~90 % cases. Give them a go.
If you struggle, we can help: https://getrector.com/hire-team
(also great way to support open source development of ongoing Rector ecosystem)