What version of PHP to code for?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
zebrax
Forum Newbie
Posts: 16
Joined: Sat Sep 14, 2002 11:39 pm

What version of PHP to code for?

Post by zebrax »

I recently ran into troubles with the differences in PHP versions.
I created a script for a guy who said his server had 4.1.1 on it. So I used $_POST and $_SESSION variables. I found out after finishing the script that his server had 4.0.6 on it.
I have to do back through all the code and change $_POST to $HTTP_POST_VARS and $_SESSION TO $HTTP_SESSION_VARS, and globalize them. Thas was a pain in the ass.

What version does everyone else code for, to make it portable.

Zebrax
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

If you want it to give out to someone use old vars but if it for you use the new... That's what I do :D
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post by jason »

4.2+ usually, or whatever the client has.

If the client has a server, I will either (A) develop on my server if I am sure enough of the similiarity of the servers, or (B), develop on their server if their is a dramatic difference.
Post Reply