Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP4 to PHP5 Migration [closed]

Tags:

php

migration

What are some good steps to follow for a smooth migration from PHP4 to PHP5. What are some types of code that are likely to break?

like image 822
ejunker Avatar asked Aug 09 '08 03:08

ejunker


1 Answers

I also once worked on an app which used PHP4's XML support quite heavily, and would have required quite a bit of work to move to PHP5.

One of the other significant changes I was looking at at the time was the change of the default handling of function parameters. In PHP4 if I remember, they were pass-by-copy unless you specified otherwise, but in PHP5 is changed to pass-by-reference by default. In well written code, that probably won't make a big difference to you, but it could certainly cause problems.

I think one other thing I found changed is that objects are no longer allowed to overwrite their 'this' field. I would say that was a really bad idea to begin with (and I think it may have not been an intentional feature in PHP4), but I certainly found a few parts of our system that relied on it.

Hope some of that helps.

like image 113
Matt Sheppard Avatar answered Oct 31 '22 01:10

Matt Sheppard