rikker Posted April 21, 2007 Share Posted April 21, 2007 Just wondering what the numbers are like. Quote Link to comment Share on other sites More sharing options...
veridicus Posted April 21, 2007 Share Posted April 21, 2007 Only switched to doing all new projects in php 5 a few months ago. Quote Link to comment Share on other sites More sharing options...
trq Posted April 21, 2007 Share Posted April 21, 2007 Ive only ever used php5. Quote Link to comment Share on other sites More sharing options...
neylitalo Posted April 21, 2007 Share Posted April 21, 2007 I added an option for "only used 5.x.x", as I've never used PHP 4, and I'm sure there are others. Quote Link to comment Share on other sites More sharing options...
rikker Posted April 21, 2007 Author Share Posted April 21, 2007 I just started using it myself since my host I just noticed supports it. I could have sworn that the last time i checked I was using 4.x.x but it is 5.1.6. What are main incompatibility problems I hear mentioned the odd time. Is it just based around the changes in OOP? Quote Link to comment Share on other sites More sharing options...
neylitalo Posted April 21, 2007 Share Posted April 21, 2007 The main compatibility changes as I can recall are: In PHP 5, objects are passed by reference instead of by value, register_globals is set to off by default, and the mysql library isn't included in the default PHP package. Quote Link to comment Share on other sites More sharing options...
redbullmarky Posted April 21, 2007 Share Posted April 21, 2007 i've recently decided to make the move completely to PHP5 after toying with it in parts for ages. Much of the stuff most useful for me is stuff I used to have to simulate or tweak on PHP4 anyway, so it saves me alot of work in that respect - but the additional OOP features have really made it easier for me to stay on top of large projects and frameworks. I just can't understand even now why hosting company support is so rubbish for PHP5 when it's so much better and much faster. Oh well. Quote Link to comment Share on other sites More sharing options...
rikker Posted April 21, 2007 Author Share Posted April 21, 2007 I just can't understand even now why hosting company support is so rubbish for PHP5 when it's so much better and much faster. Oh well. Right, I was very surprised how many of the hosting companies that I was checking out were still supporting the 4.x.x versions. I could understand them saying you have a choice, but a lot were just offering 4.x.x. Up until a couple weeks ago whenever I used PHP it was in ver 4 and never really gave 5 a thought. Maybe it is this type of thinking that is the driving factor behind hosts not going to 5. As you say though and from from what neylitalo said, the majority of the code is the same and those changes that were made are making it just that much more powerful. I know that I was running some of my old scripts on my new server before I even realized it was php 5.1.6 and they ran no problem. Quote Link to comment Share on other sites More sharing options...
redbullmarky Posted April 21, 2007 Share Posted April 21, 2007 yeah. the "changes" are more additions than proper changes, so PHP4 scripts tend to fall under two categories: a) works fine or b) needs a couple of adjustments to work fine. there are some things that PHP5 just "breaks" by default (like register_globals, etc) that will just send certain PHP4 sites tits up - but they shouldnt have been written with support for register_globals being on in the first place (or at least should have been changed), same with other bits that have LONG been advised, even much before PHP5 was even introduced. But you're probably right when you say: Maybe it is this type of thinking that is the driving factor behind hosts not going to 5. At one time, I remember when it was advisable to turn Javascript/cookies, etc off in your browser and live a nice happy comfortable surfing life - but nowadays, all that's changing because of the "introduction" of things like AJAX/DHTML and libs such as Mootools/Script.aculo.us, etc to the mainstream as simpler, lightweight, dare i say easier alternatives to Flash. I guess it takes time, but it also takes a large movement of people to say "sod it, we need to move forward and if people wanna drag their feet, then let them" Oh well. Personally though, I only had these worries about PHP4/5 when I was on a regular hosting platform, but now I tend to prefer VPS/dedicated server where I can install the necessary bits and pieces if I wish - and for clients, I can either host their site for them or advise of decent hosts that support PHP5 at least as an option. Quote Link to comment Share on other sites More sharing options...
rikker Posted April 21, 2007 Author Share Posted April 21, 2007 Yes I remember when everyone was worried about leaving Javascript and even cookies enabled. You're right about saying that with the increased popularity of AJAX etc, that leaving cookies on has pretty much become mandatory ... (not that I ever turned mine off). I still prefer flash for my dynamic stuff, but then again that is probably because all i Know about AJAX is what it can accomplish and how to spell it. lol yeah register_globals have been a no no since PHP 4.2 Quote Link to comment Share on other sites More sharing options...
rcorlew Posted April 22, 2007 Share Posted April 22, 2007 I started writing code for php3, that was some time ago. I think that most hosting companies are only using "Prebuilt" server software. Mostly they buy a server like we buy a pc, preconfigured or worse, they rent servers from whatever sompany and presto they are a webhost. I think that time presses on and site admins are tired of getting hacked because of session spoofing and sql injection that are easily fixed with functions like sanitize() and so on. My host uses only 4.3 or so, I test on 5, so all my code will just drop into place without any of the added functions. Maybe the smaller hosts will catch up, even some of the big ones are still running 4, but that maybe that demand for it is not that high. Quote Link to comment Share on other sites More sharing options...
ober Posted April 23, 2007 Share Posted April 23, 2007 Mainly 5 here... although I still have a few clients that are hosted on 4x boxes and I have to figure that into my coding. Quote Link to comment Share on other sites More sharing options...
steviewdr Posted April 23, 2007 Share Posted April 23, 2007 Well - with debian releasing etch which has php 5.1 - I've dist-upgraded. -steve Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted April 23, 2007 Share Posted April 23, 2007 My first site was done in 4 and my work site is set up in 4 as well. My latest personal project, of which I've not written any code yet, will be done in 5. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.