Switching to a new version of PHP

I noticed that a couple of weeks ago, PHP 5.3 reached the stage of selecting a candidate (woo!), But then, seeing that the list of already obsolete functions was permanently deleted, made me wonder if it would break my old code.

Without running the suck-it-and-see test (installing on the test server and trying it), are there any migration tools that can analyze your code to highlight problems? For example, if ereg_* functions are used in some scenarios.

+4
source share
2 answers

One of the methods you can use is to take a list of obsolete functions that are being removed, and grep for them. The small fu script is very important for such things.

Suppose you have a deprecated.txt file with deprecated function names, one per line:

 for func in `cat deprecated.txt` do grep -R $func /path/to/src done 

This will tell you all instances of deprecated functions that you use.

+4
source

Nothing beats installing on a test server and doing unit tests. You have unit tests, right ?;)

+1
source

All Articles