PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
A quick question about PHP delimiters. A client is prepping to migrate their site from one server to another, and it just occurred to me that I've noticed a lot of PHP code with only the <? delimiter, ie:
I was thinking I could perform a global find and replace with BBEdit (my editor of choice). This is a massive site, and my initial search found nearly 3000 instances of the code in question. So, definitely something I want to tackle BEFORE deployment to the new server, so I can do a local search.
Are there any other code issues I should search for to make sure the site will function on newer versions of PHP?
I'll poke around and see if there's a hint of any of those in play. As I said, the site is over 1,000 pages. They really only used PHP for includes and the like (hence, the enormous size), so I'm hoping we'll be OK.
Dudes, that is totally the wrong approach. feyd already mentioned it, and I will reiterate it, do not make your PHP5 installation that same insecure, outdated crap that a PHP3 install would be. Would you turn on register_globals just so your code will work, or will you make your code better so it will work on a more secure setup?
Leave short tags off. Leave register_globals off. If this is a production system, turn off display_errors and display_startup_errors. You might also want to lower your error_reporting from E_ALL (or E_STRICT in PHP5) to E_ALL ~ E_NOTICE to prevent unwanted notice level reports form spashing to the screen. If you are talking to a Sybase or MSSQL server database, raise your database error severity levels to 16 from the default 11 to prevent changing context notices.
Then, after checking into the things feyd has stated, make sure you check your code for objects that are passed by reference, as PHP5 does not like that much. Also, make sure the appropriate extensions are loaded on the new server so that any extension used on the old server are maintained (so your code doesn't break because of an extension issue).