Jump to content

Writing php to fit on all php version.


ok

Recommended Posts

Hi guys.

 

I want my php programming skills to fit on different version as many version as possible.

 

Is there an article that teaches this issue, or what are the things that i should consider.

 

I just want my codes universal on different version.

 

Thank you.

 

 

 

 

 

Link to comment
Share on other sites

Because different hosting use different version of php.

 

And to avoid headache when you transfer your system into different server that support different version of php.

 

yeah i agree codes that fit with 4.0 and higher.

 

i don't care 3.9 or lower since they are really useless and very outdated.

Link to comment
Share on other sites

I would think most hosts to be using the latest version of PHP4, which is 4.4.9. Only tips I can give you are when you are using a function, if you really want it to work on PHP4, check the manual and at the top it tells you what versions the function will run on.

Link to comment
Share on other sites

Except in a very few cases, code that runs under php4 will run under php5 (given the same php.ini configurations) - http://us.php.net/manual/en/migration5.incompatible.php

 

Most of the problems will be due to php.ini configuration differences. Unfortunately, a number of poor choices were made in early php versions, in the name of "saving the programmer a little typing" and in getting the language to do things the programmer should have been doing and only when he wanted them to be done, that have since been turned off, removed, or soon to be removed, due to the security and functional problems they caused.

 

If you write code on a php4 system that is using the current "recommended" php.ini settings, it will run on a php5 system that is also using the current recommended php.ini settings. And code that is written to work using the current recommended php.ini settings will usually work on systems that are not using the recommended settings, but the not the other way around.

Link to comment
Share on other sites

I was going to mention that the end of life and end of support of php4 was 10 months ago. No one should be signing up for a new hosting account that only provides php4 and those that are still on a hosting account with php4 should have checked with their host on how to upgrade their account to php5 and should have tested and modified their scripts to work under php5.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.