<p>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?</p>

[{'answer_id': 6606, 'author': 'Mark Biek', 'author_id': 305, 'author_profile': 'https://Stackoverflow.com/users/305', 'pm_score': 1, 'selected': False, 'text': '<p>We had an app that relied heavily on the PHP 4 XML DOM functions and it required a lot of retooling to change over PHP 5.</p>\n\n<p>Beyond that most changes were improvements to things like error handling (to take advantage of exceptions) and PHP Classes.</p>\n'}, {'answer_id': 6617, 'author': 'Matt Sheppard', 'author_id': 797, 'author_profile': 'https://Stackoverflow.com/users/797', 'pm_score': 4, 'selected': True, 'text': "<p>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.</p>\n\n<p>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.</p>\n\n<p>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.</p>\n\n<p>Hope some of that helps.</p>\n"}, {'answer_id': 6625, 'author': 'Akira', 'author_id': 795, 'author_profile': 'https://Stackoverflow.com/users/795', 'pm_score': 2, 'selected': False, 'text': '<p>The best advice I could give anyone working with PHP4 is this:</p>\n\n<pre><code>error_reporting( E_ALL );\n</code></pre>\n\n<p>It pretty much will tell you exactly what you need to do.</p>\n'}, {'answer_id': 20421, 'author': 'Ross', 'author_id': 2025, 'author_profile': 'https://Stackoverflow.com/users/2025', 'pm_score': 1, 'selected': False, 'text': "<p>OOP is one of the largest differences. It won't break as the PHP4 and PHP5 OOP styles are interchangeable but I'd reccommend taking advantage of PHP5's new OOP styles. It's not a huge amount of work to convert your existing classes to PHP5 and it does give you some extra magical methods that may help solve some existing hacks (I remember having a near useless __toString equivalent method in most classes).</p>\n"}]
['https://Stackoverflow.com/questions/6594', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/796/']