I have written most of my own scripts and looking to update them. So before I change the php setting to php7 I need to update the scripts. Where can I get a list of the old commands pre php7 and after php5 ? (without having to check each and every command on php.net !)
This section of php.net has instructions on how to migrate from each PHP version to the next. I recommend you go through each one and test them one at a time.
Another approach is to make a copy of your code and just run it with error reporting turned on. Php will tell you exactly what needs to be updated.
By the way, we are up to Php 8 now so you may as well get current if you are updating the code. If you are on Windows, Laragon makes for a great local dev environment and allows you to easily switch between multiple Php versions.
I am wanting to know what commands are not valid before I upgrade otherwise the sites stops working until I fix every error !
I think my question should have been what are the deprecated commands from php5 to php7 ?
Did you miss the part about “make a copy”? Sounds like you work on the site on the live server. Do not do that! Set up a local dev environment with Laragon and work on a COPY of the code there. When you have it updated you can update the live server. There is no reason the site should go down.
There are more changes to php than just removed commands that you will need to update. Two notable changes, the removal of register_globals and magic_quotes, depending on your starting php5 version, will require that any code that was dependent upon those to be re-written to use the correct super-global variables and to supply proper security against sql special characters in data from breaking sql query syntax, i.e. sql injection.
The php.net documentation appendix that @skawid linked to, which in turn links to the other migration sections, is the most important resource for you to use to determine what will need to be updated in your code.
For the subject of a database extension, don’t waste your time with the mysqli extension. Use the simple and easy to use PDO extension, use a prepared query when supplying external, unknown, dynamic data to the query when it gets executed, use implicit binding (supply an array if input values to the ->execute([…]) call), and use exceptions for errors and in most cases let php catch and handle the exception. Doing these things will eliminate a huge amount of implementation code, rather than to convert/update it.
Best approach is just what others have said. Save your original copy, then run on php7. If need be, do console.log in some key parts of your scripts
You may try the following: