View Full Version : PHP4 and 5
ProgramWizard
12-16-2005, 02:24 PM
How big a difference is there between PHP4 and 5? I'm writing my PHP scripts in PHP5, but my webhost only supports PHP4.
Methulah
12-16-2005, 02:55 PM
There shouldn't be an issue unless you go deep into sessions. I think they extrapolated greatly on that in PHP5.
.oisyn
12-16-2005, 05:27 PM
The difference is that they both suck ;)
Reedbeta
12-16-2005, 10:21 PM
Aww, .oisyn. Why hating on PHP?
The only difference I've encountered in practice was that PHP4 is missing a few date/time manipulation functions that PHP5 has. But this was just a minor inconvenience (difference between writing idate(blah) and intval(date(blah))).
.oisyn
12-17-2005, 09:30 AM
Oh come on, the whole reason for the success of PHP is that hosting is widely available and it's fairly simple to get it started. Which is indeed a good thing.
But the pro's end there, the con's are that it's a terribly hobby project gone bad. The whole language and library is inconsistent and poorly designed. They tried to give PHP a more professional image with PHP 5 by implementing better OO functionality but they failed miserably.
If you ask me, it's time for the Zend team to start completely from scratch with a good designed language. But I don't want to turn this thread in a PHP discussion, my previous post was more meant as a joke than as a troll, so I'll keep my mouth shut from now on ;)
monjardin
12-17-2005, 09:37 AM
@.oisyn: Well, as long as you have brought it up... What is your favored alternative?
.oisyn
12-17-2005, 09:48 AM
Well there isn't any, actually, I use PHP myself ;). Or you should consider Java servlets or ASP(.Net) as alternatives, but I think they are both much too bloated to write a simple script. PHP has definitely an advantage there.
I once had the idea to create an alternative loose-typed scripting language with a syntax more closer to C++, but I don't really have the time to write it :)
monjardin
12-17-2005, 09:59 AM
That's about what I thought you would say. :p I am inclined to agree with you though.
I think .oisyn mostly expresses the frustration of coding. We want to make the simple things quickly, without all the tedious typing. But there just isn't such a product.
Have a look at Ruby On Rails, though. The concept is pretty interesting, even if I doubt it's usefullness in real situations.
eddie
12-18-2005, 11:11 AM
I've heard good things about RoR; but I haven't been able to use it yet. I should pick it up some time.
That said, PHP has a definite advantage of being almost ubiquitous and being very easy to write in.
Personally I don't mind PHP. I haven't done much PHP5, but PHP4 + Smarty usually makes me pretty happy. :)
.oisyn
12-19-2005, 03:49 AM
I think .oisyn mostly expresses the frustration of coding. We want to make the simple things quickly, without all the tedious typing. But there just isn't such a product.
No, I'm talking about the actual bad design of the language. The current concepts of globals and references, for example, are a crime and definitely need to go. And why is null equal to a zero-length string or 0? And why is "12ab" equal to 12? And why don't the [] and () operators work on the result of a function call, while all other operators do work? And continue in a switch, what's up with that?
And why is "12ab" equal to 12? And why don't the [] and () operators work on the result of a function call, while all other operators do work?
The "12ab" == 12 part seems natyural to me. At least if you are comparing a string with an int, without any preparations of the string. Remember, you could easily make it "12ab" == 12."" if you wanted the comparision to be more strict. Or you could be even more strict by making it "12ab" === 12, but that would only be usefull to protect you from type missmatch.
I agree totally though on the [] and () operators. Totally stupid. Should be fixed.
.oisyn
12-20-2005, 03:35 AM
The "12ab" == 12 part seems natyural to me
Not to me, the string "12ab" shouldn't be convertible to an int. For example, suppose I've written forumsoftware and you want to access a topic using the url forum.php?topic=topicnumber. "12ab" for topicnumber is an invalid index, it should definitely not get topic 12. But there's no good way to detect whether such a string is really a number, the is_int function only checks for the runtime type of the variable, and because it's a string it returns false. A check against (int)12 returns true, even $topic == (int)$topic returns true.
If you really want to check if a value is an int you should do $a == (string)(int)$a. I'm sorry, but that's just bad design in my book. The autoconversion routines should be way more strict than they currently are, this will also solve a lot of newbie problems.
ProgramWizard
12-26-2005, 11:42 AM
Jumping back in, I like working with PHP. I get things done with it a lot quicker than with ASP(.NET). I doubt it would be used by so many websites and companies if they didn't think the same ;)
BTW, like these forums? They're written in PHP :lol:
.oisyn
12-26-2005, 05:46 PM
Success is no good reason for not being critical ;)
zavie
12-26-2005, 06:17 PM
@.oisyn: Well, as long as you have brought it up... What is your favored alternative?
I've heard many people saying Ruby was a very well designed scripting language. I haven't tried it yet though.
Methulah
12-27-2005, 01:38 AM
@ProgramWizard: Most popular forums are written in PHP, simply because it interacts nicely with MySQL, has good hosting support and is very easy to script in.
Me, I love PHP, it is my favourite language, but after all, I'm not a coder. I think Perl is good for more extensive things, and if you really want to go hard, ASP code-behind is undeniably powerful. At the end of the day though, for most situations, PHP makes sense, and damn it makes it easy.
ProgramWizard
12-27-2005, 05:37 AM
A bit off-topic, but I've heard of people getting masters degrees in PHP. Not sure why I wanted to bring that up...
eddie
12-27-2005, 07:40 PM
I've never heard of a "Masters in C++" myself, either.
ProgramWizard
12-28-2005, 08:18 AM
I've never heard of a "Masters in C++" myself, either.
Huh? I've heard of a Master's degree in C++...
.oisyn
12-28-2005, 09:43 AM
How pointless, what would such a master's degree involve?
ProgramWizard
12-28-2005, 12:42 PM
Knowing how to program really good in whatever language you got it for, I guess. Maybe it would also entail all of the common API's for the language.
darqSHADOW
12-28-2005, 01:17 PM
We want to make the simple things quickly, without all the tedious typing. But there just isn't such a product.
ASP.Net gives you this ability quite nicely. I can actually get products to market much faster using ASP.Net than PHP -- both of which I consider myself an expert programmer with, except I've used ASP.Net for only 4 years, and PHP for closer to 10.
Huh? I've heard of a Master's degree in C++...
There is no such thing. You might have a Masters Degree in CS, but not in C++ or PHP directly. There is NO way a school would dedicate an entire masters program to such a small subset, nor would anyone pay the hundreds of thousands of dollars a Masters Degree costs. (Btw, I have two Masters degrees, so I have been through the process of selecting from the list...)
DS
ProgramWizard
12-30-2005, 06:49 AM
PHP for closer to 10.
You mean PHP has been out for over 10 years :blink:
.oisyn
12-30-2005, 07:44 AM
Knowing how to program really good in whatever language you got it for, I guess. Maybe it would also entail all of the common API's for the language.
Maybe for a college degree, but I don't see that being a master's degree.
vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.