Re: how old is this version of PHP?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Far too much is made of BC breaks between PHP versions. Well-behaved code should still be working a decade later.

The catch is that "well behaved" gets tighter each release.  For example:

$foo = "hello";
$bar = "world";
print $foo[$bar];

In PHP 5.3 and earlier, $bar is a string which makes no sense as an index of a string. It needs to be an int. PHP therefore casts that to an int, gets 0, and you get "h".

In PHP 5.4, that was acknowledged as a bug (which it always was), and now triggers a Warning. Because, really, it always was a bug but just failed silently before. Now it tells you so you can fix it. It looks like a BC break, though, because "I get an error I didn't used to".

Other things are, eg, removing register_globals and magic_quotes, which have been deprecated for about 12 years and if you were still using them now then your code should break. :-) They're a security hole. But those are very few and far between.

--Larry Garfield

On 8/19/13 7:25 AM, Jeff Burcher wrote:

I apologize if this is off topic, but this raises a question for me. Why
can't new versions be backwards compatible? Is it really that difficult to
accomplish? This has been a complaint of mine for years with Windows ever
since we went from 95 to 98. I am an AS400 programmer and I have legacy
programs written in RPG II, which died 20 years ago, and they still run fine
on the newest version of AS400 or iSeries or Power System or whatever the
heck it is called now. I also have PHP scripts that are many years old that
work just fine the way they are, if a new version doesn't come along and
make me have to reprogram for no reason just because it can't handle older
code. Really, have Do loops and data calls changed that much over the years?
I mean, all you do is set a condition, use a variable key field, and voila,
data is pulled and processed, no big deal. Yeah, you can get fancy with it,
but the core basics are still the same. I have been programming for over 35
years and like to think that once a program is built it should run forever.
Do we just accept that we have to rewrite every program we ever wrote every
time a new version comes out? A little extreme, but you get my point.
Comments? Suggestions?

(I am also the kind of guy who thinks quality made hand tools from the 1800s
are superior to many purchased today at Lowes or Home Depot.)

Thanks,

Jeff Burcher - IT Dept
Allred Metal Stamping Works
"Making Metal Parts since 1946."


-----Original Message-----
From: Lester Caine [mailto:lester@xxxxxxxxxxx]
Sent: Monday, August 19, 2013 6:24 AM
To: php-general@xxxxxxxxxxxxx
Subject: Re:  how old is this version of PHP?

Larry Garfield wrote:
5.2.9 was released in February of 2009.  5.2 is completely retired and
out of support.  5.3 is on security-only life-support.  5.4 is the
legacy stable
release.

Yes, 5.2.9 IS that old. :-)  Really, get a host that has made it into
this decade.  (GoDaddy apparently doesn't meet that qualification.)
You're doing clients a disservice by allowing them to run such an
ancient and unsupported version.

While the statements are correct, many users are not in a position to move
from their currently working systems to even 5.3 let alone 5.4. There is
still a
lot of legacy code that unless a few more people step up and help bring it
forward for the many - non programming - users who are stuck with legacy
applications, they will remain requiring 5.2 to run. ISPs got caught out
when
they arbitrarily moved accounts forward, and GoDaddy have even been
caught by that, so maintaining a LTS version of PHP5.2 is the lesser evil
...
Windows 2000 is supposed to be dead, but *I* still have sites reliant on
it
because the code and hardware is unsupported in even XP. Saying
something is dead only works if there is an affordable way of moving
forward
;)

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve -
http://enquirysolve.com/ Model Engineers Digital Workshop -
http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux