Requirements for things you will release
Moderator: General Moderators
Requirements for things you will release
I'm working on a project that uses parts of PHP available in 5, specifically 5.1. Should I use things available in new versions? What balance between using new features and limiting yourself to old is a good idea? I don't want to make things extremely hard for myself to code by sticking with old stuff, but I want my projects to appeal to wide(-ish) audiences...What do you do? Should I even care about PHP4 since 5 has been out for over 2 years now?
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Re: Requirements for things you will release
It's a constant trade-off - I'd feel comfortable requiring php5 unless compatibility is trivial to achieve.
function_exists() is your friend in those cases:
function_exists() is your friend in those cases:
Code: Select all
if(!function_exists('some_php5_function'){
function some_php5_function($args){
//replacement legacy workaround code
}
}) Re: Requirements for things you will release
Depends on who you want to use your code. If you want the widest audience possible then you'll need to support PHP4 because there are lots of people who won't upgrade.
That said though I'm of the opinion that open source projects that continue to support PHP4 are actually damaging PHP's audience. It's time to move on to 5, and the more reasons people have to upgrade the better. If a particular piece of software isn't available on 4 then they'll have to make a choice to either switch to 5 or use a different application. If we write best-in-class software that only works in 5 then everyone will make the sensible choice.
That said though I'm of the opinion that open source projects that continue to support PHP4 are actually damaging PHP's audience. It's time to move on to 5, and the more reasons people have to upgrade the better. If a particular piece of software isn't available on 4 then they'll have to make a choice to either switch to 5 or use a different application. If we write best-in-class software that only works in 5 then everyone will make the sensible choice.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: Requirements for things you will release
100% agree with this. I've seen a lot of open source projects dropping PHP4 support since December. Hopefully that number will increase. Next we'll have a PHP5/6 divide thoughonion2k wrote:That said though I'm of the opinion that open source projects that continue to support PHP4 are actually damaging PHP's audience. It's time to move on to 5, and the more reasons people have to upgrade the better. If a particular piece of software isn't available on 4 then they'll have to make a choice to either switch to 5 or use a different application. If we write best-in-class software that only works in 5 then everyone will make the sensible choice.