Is there any easy way to change code from PHP4 to PHP5?

Discussion in 'PHP' started by TheSyndicate, Mar 8, 2009.

  1. #1
    Is there any easy way to change code from PHP4 to PHP5?

    If i have a script in PHP4 is there any easy way to change it to PHP5 or is only hand code that is possible?
     
    TheSyndicate, Mar 8, 2009 IP
  2. DGK

    DGK Peon

    Messages:
    73
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You don't need to convert the code. Just use it with php5.
    There is difference between php4 and php5 only in some functions - mostly in the object functions. You will see the errors if php5 don't supports the functions in your code and then you should find a way to replace them with the new functions.
    Good luck!
     
    DGK, Mar 8, 2009 IP
  3. TheSyndicate

    TheSyndicate Prominent Member

    Messages:
    5,410
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    365
    #3
    like all my code is messed up they can not do anything. My web says will take a week to change it?
     
    TheSyndicate, Mar 8, 2009 IP
  4. yoes_san

    yoes_san Peon

    Messages:
    443
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I've seen some auto app that change php4 codes to php5 codes but I don't think they'll work.

    Best thing to do is to modify your codes from php4 to php5 on local machine and upload the php5 codes to server when you're ready so you can still have an online website while developers work on the migration.

    I currently use php4 on one of my site, and switching to php5 can take me a month to review all codes. I won't switch the version unless I really need the functions on new version.
     
    yoes_san, Mar 9, 2009 IP
  5. TheSyndicate

    TheSyndicate Prominent Member

    Messages:
    5,410
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    365
    #5
    Well my server went from php4 to php5 so some stuff are not working thats the porblem
     
    TheSyndicate, Mar 9, 2009 IP
  6. nabil_kadimi

    nabil_kadimi Well-Known Member

    Messages:
    1,065
    Likes Received:
    69
    Best Answers:
    0
    Trophy Points:
    195
    #6
    That's a good thing that your server stopped supporting PHP 4, you can fix the errors one at a time or have someone else to do it for you, or you can post the errors you get on DP forums.
     
    nabil_kadimi, Mar 9, 2009 IP
  7. TheSyndicate

    TheSyndicate Prominent Member

    Messages:
    5,410
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    365
    #7
    i guess so sucks to have to check a total script :(
     
    TheSyndicate, Mar 9, 2009 IP