Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Dell PowerEdge Servers
  #1  
Old July 19th, 2002, 01:15 AM
cuboctahedron cuboctahedron is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Netherlands
Posts: 420 cuboctahedron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 34 m 55 sec
Reputation Power: 6
is PHP savely backwards compatable?

Hi,
currently I am learning PHP.
I am just wondering about the policy of next(future) verions of PHP, if they will be backwards compatable.

The reason: I would hate if I had to rewrite a website because I didnt consider it.

I am doing PHP now is because Microsoft launched ASP.net which is different in alsmost everything to ASP3.0, so I figured changing, since I dont want to learn the same language twice

Patrick

Reply With Quote
  #2  
Old July 19th, 2002, 05:18 AM
NoXcuz's Avatar
NoXcuz NoXcuz is offline
Wiking
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Sep 2000
Location: Sweden
Posts: 3,608 NoXcuz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 49 m 27 sec
Reputation Power: 11
To a certain extent, yes. If you checkout PHP's changelog you'll see what changes between versions. But some things changes and will eventually be removed from a new version of PHP, so you can never be sure...

//NoXcuz
__________________
UN*X is sexy!
who | grep -i blonde | date; cd ~; unzip; touch; strip; finger; mount; gasp; yes; uptime; umount; sleep

Reply With Quote
  #3  
Old July 19th, 2002, 07:57 AM
cuboctahedron cuboctahedron is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Netherlands
Posts: 420 cuboctahedron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 34 m 55 sec
Reputation Power: 6
So a site made in PHP3 would not run properly on PHP4?
Well.. I hope than they not gonna change version number every year

Patrick

Reply With Quote
  #4  
Old July 20th, 2002, 07:59 PM
Hero Zzyzzx's Avatar
Hero Zzyzzx Hero Zzyzzx is offline
11
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jul 2001
Location: Lynn, MA
Posts: 4,632 Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 23 h 12 m 33 sec
Reputation Power: 76
Send a message via AIM to Hero Zzyzzx
One nice thing about open-source/free software scripting languages like perl, PHP, or python is that they don't have an incentive to increase version numbers by releasing too early- For instance, PHP4 is VERY improved over PHP3, just as perl 5.6.x has a lot more to it than perl 4 or even perl 5.x.

Basically, there is an attitude of "we'll release when we're damn well ready," but that usually means the releases are very meaningful. You can't really say that about a lot of commercial software.

If some behavior breaks in an upgrade from PHP3 to PHP4, there was probably a very good reason for it- the old behavior was a failed experiment, insecure, or some other reason. I think you can assume that code written for PHP4 will upgrade pretty simply to the new versions of PHP. Anyone have significant problems moving PHP3 code to PHP4 ? I haven't heard any horror stories. . .

Last edited by Hero Zzyzzx : July 20th, 2002 at 08:03 PM.

Reply With Quote
  #5  
Old July 21st, 2002, 04:50 AM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
no horror stories. only some tweaking here and there. and i agree, all this has been changed for good reasons, so you should definitively get used to the newer versions.

some problems arise from different default configuration, like the register_globals. again, this is for a good reason
__________________
--
Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more.

Reply With Quote
  #6  
Old July 21st, 2002, 08:57 AM
Hero Zzyzzx's Avatar
Hero Zzyzzx Hero Zzyzzx is offline
11
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jul 2001
Location: Lynn, MA
Posts: 4,632 Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 23 h 12 m 33 sec
Reputation Power: 76
Send a message via AIM to Hero Zzyzzx
I was VERY happy to hear about the changed register_globals behavior- I always "registered" by variables before anyway, so it didn't effect me.

I just don't like anyone being able to stuff variables into my scripts by appending extra query strings. . . Call me crazy.

Reply With Quote
  #7  
Old July 21st, 2002, 09:24 AM
cuboctahedron cuboctahedron is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Netherlands
Posts: 420 cuboctahedron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 34 m 55 sec
Reputation Power: 6
But with the global, e.g. used like register_session. Those settings are settled in the php.ini file. If a provider suddenly changes those settings your site wouldnt work, or can different sites be adjusted seperately?

Reply With Quote
  #8  
Old July 21st, 2002, 09:34 AM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
afaik some php settings can also be overridden in .htaccess
but i canīt tell which ones and of couse you need permission to use .htaccess

Reply With Quote
  #9  
Old July 21st, 2002, 09:47 AM
cuboctahedron cuboctahedron is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Netherlands
Posts: 420 cuboctahedron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 34 m 55 sec
Reputation Power: 6
adding this to a script with regards to globals to pages:

<?php ini_set("register_globals", "0"); ?>

Can that overrule anyting else?
You see I am making a nice website currently (on a local machine), but would hate to redign it a soon when I find a provider that doenst support $_SESSION....

Reply With Quote
  #10  
Old July 21st, 2002, 09:57 AM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
use:

global $HTTP_SESSION_VARS

instead. afaik it is available since php supports sessions (4.0). then you are on the safe side.

i doubt this line of code overrides the setting, since it is already active when the parser reaches this line...

Reply With Quote
  #11  
Old July 22nd, 2002, 02:46 AM
twigletmac's Avatar
twigletmac twigletmac is offline
codegirl
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: Essex, UK
Posts: 77 twigletmac User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 9 sec
Reputation Power: 7
Quote:
You see I am making a nice website currently (on a local machine), but would hate to redign it a soon when I find a provider that doenst support $_SESSION....

$_SESSION will be supported whether register_globals is on or off (and PHP version is 4.1 or greater). So you won't have to rewrite your code if your host turns register_globals on. Since those arrays are a fairly recent addition it's unlikely they'll be going anywhere soon either.

Mac
__________________
easier is relative

Reply With Quote
  #12  
Old July 22nd, 2002, 07:56 AM
rod k rod k is offline
Apprentice Deity
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jul 1999
Location: Niagara Falls (On the wrong side of the gorge)
Posts: 3,237 rod k User rank is Private First Class (20 - 50 Reputation Level)rod k User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 m 8 sec
Reputation Power: 12
Send a message via AIM to rod k
Quote:
adding this to a script with regards to globals to pages:

<?php ini_set("register_globals", "0"); ?>

Can that overrule anyting else?


No, that won't work. register_globals is not (and cannot) be affected by ini_set().
__________________
FSBO (For Sale By Owner) Realty

Reply With Quote
  #13  
Old July 22nd, 2002, 09:04 AM
cuboctahedron cuboctahedron is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Netherlands
Posts: 420 cuboctahedron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 34 m 55 sec
Reputation Power: 6
quote:
-------------------------------------------------------------
$_SESSION will be supported whether register_globals is on or off (and PHP version is 4.1 or greater).
-------------------------------------------------------------
http://www.zend.com/manual/ref.session.php

saying
"...As of PHP 4.0.3, track_vars is always turned on...."

furthon saying
"....If track_vars is enabled and register_globals is disabled, only members of the global associative array $HTTP_SESSION_VARS can be registered as session variables. The restored session variables will only be available in the array $HTTP_SESSION_VARS..."

Oh well, I guess that doenst count than or $_SESSION...

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > is PHP savely backwards compatable?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared b