r/PHPhelp • • 28d 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

12 comments sorted by

View all comments

Show parent comment

3

u/obstreperous_troll 27d ago

Rector used to have a ruleset for converting mysql_* functions to mysqli but I can't find it in recent versions anymore. No idea where it went — I imagine /u/tomas_votruba knows?

4

u/allen_jb 27d ago

According to comments on issues in the Rector repo it was breaking more than it was helping, so was removed.