[thelist] PHP 4 to PHP 5

Mark Groen evolt at markgroen.com
Mon Mar 5 19:36:20 CST 2007

On Monday 05 March 2007 15:55, Max Schwanekamp wrote:
> Paul Bennett wrote:
> > Apart from the Object Model changes, is anyone aware of other issues
> > arising from migrating from PHP 4x to PHP 5? (IE: Changes in function
> > returns, how some functions work etc)
> Um, that's a pretty broad question.  Yes, there's quite a lot.  No, most
> existing core functions are still the same -- it is still PHP, and most
> PHP4 scripts will run just fine under PHP5.  A few extensions got moved
> into PECL, a bunch of new stuff got added.

When updating php4 apps to php5, changing servers etc., often I find that the 
old script was written with undefined variables, so you need to create a 
class/function to put the variable in a global scope or similar, else go to 
the variable line in the script and add an "isset" to it, or @supress errors 

Built in functions pretty much work the same as noted above, the php.net site 
is helpful when you run into something that used to work that doesn't in 

IMHO, PHP5 makes for better code in the long run.


More information about the thelist mailing list