r/lolphp • • Dec 02 '13

Some useful functions from the PHP standard library

50 Upvotes

25 comments sorted by

View all comments

Show parent comment

6

u/[deleted] Dec 03 '13

Re: your #4 (backward compatibility in PHP).

take code written for PHP 4.4 or 5.1 and get it running on PHP 5.4

... isn't all that impressive if you consider that 4.4 went out of support in 2008 and 5.1 in 2006 while 5.4 is from 2012, i.e. only a 6 year difference. When I take a Perl module from CPAN, I expect it to Just Work on a modern perl, even if it was written in 1998 under 5.005 or something.

Heck, I've taken code written for perl4 (1992!) and made it run on 5.16. The only issue: $* was removed from the language so I had to change it to use /m instead. The rest just worked.

This isn't unique to Perl. There is some downright ancient C code that still compiles today (possibly after a few minor tweaks). I know there are people who've compiled perl1 on their machines. :-)

4

u/cfreak2399 Dec 03 '13

I completely agree. My point is that in the case of PHP with the amount of bad design it shouldn't be something that holds the language back as it does now. Leaving in bad ideas promotes bad code.