Jump to content


PHP4 and 5


24 replies to this topic

#1 ProgramWizard

    Valued Member

  • Members
  • PipPipPip
  • 143 posts

Posted 16 December 2005 - 09: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.
Firefox: ProgramWizard's official web browser
Get Firefox
Spread Firefox
hi, i'm a signature viruz, plz set me as your signature and help me spread :)

#2 Methulah

    Senior Member

  • Members
  • PipPipPipPip
  • 727 posts

Posted 16 December 2005 - 09:55 PM

There shouldn't be an issue unless you go deep into sessions. I think they extrapolated greatly on that in PHP5.
Django Merope-Synge :: django@white-epsilon.com
Lead Designer/Project Manager - White Epsilon

#3 .oisyn

    DevMaster Staff

  • Moderators
  • 1810 posts

Posted 17 December 2005 - 12:27 AM

The difference is that they both suck :)
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.

#4 Reedbeta

    DevMaster Staff

  • Administrators
  • 4782 posts
  • LocationBellevue, WA

Posted 17 December 2005 - 05:21 AM

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))).
reedbeta.com - developer blog, OpenGL demos, and other projects

#5 .oisyn

    DevMaster Staff

  • Moderators
  • 1810 posts

Posted 17 December 2005 - 04:30 PM

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 :)
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.

#6 monjardin

    Senior Member

  • Members
  • PipPipPipPip
  • 1033 posts

Posted 17 December 2005 - 04:37 PM

@.oisyn: Well, as long as you have brought it up... What is your favored alternative?

#7 .oisyn

    DevMaster Staff

  • Moderators
  • 1810 posts

Posted 17 December 2005 - 04:48 PM

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 ;)
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.

#8 monjardin

    Senior Member

  • Members
  • PipPipPipPip
  • 1033 posts

Posted 17 December 2005 - 04:59 PM

That's about what I thought you would say. :p I am inclined to agree with you though.

#9 geon

    Senior Member

  • Members
  • PipPipPipPip
  • 812 posts

Posted 18 December 2005 - 02:24 PM

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.

#10 eddie

    Senior Member

  • Members
  • PipPipPipPip
  • 751 posts

Posted 18 December 2005 - 06:11 PM

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. :)

#11 .oisyn

    DevMaster Staff

  • Moderators
  • 1810 posts

Posted 19 December 2005 - 10:49 AM

geon said:

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?
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.

#12 geon

    Senior Member

  • Members
  • PipPipPipPip
  • 812 posts

Posted 20 December 2005 - 07:25 AM

.oisyn said:

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.

#13 .oisyn

    DevMaster Staff

  • Moderators
  • 1810 posts

Posted 20 December 2005 - 10:35 AM

Quote

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.
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.

#14 ProgramWizard

    Valued Member

  • Members
  • PipPipPip
  • 143 posts

Posted 26 December 2005 - 06:42 PM

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:
Firefox: ProgramWizard's official web browser
Get Firefox
Spread Firefox
hi, i'm a signature viruz, plz set me as your signature and help me spread :)

#15 .oisyn

    DevMaster Staff

  • Moderators
  • 1810 posts

Posted 27 December 2005 - 12:46 AM

Success is no good reason for not being critical :lol:
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.

#16 zavie

    Member

  • Members
  • PipPip
  • 91 posts

Posted 27 December 2005 - 01:17 AM

monjardin said:

@.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.

#17 Methulah

    Senior Member

  • Members
  • PipPipPipPip
  • 727 posts

Posted 27 December 2005 - 08: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.
Django Merope-Synge :: django@white-epsilon.com
Lead Designer/Project Manager - White Epsilon

#18 ProgramWizard

    Valued Member

  • Members
  • PipPipPip
  • 143 posts

Posted 27 December 2005 - 12:37 PM

A bit off-topic, but I've heard of people getting masters degrees in PHP. Not sure why I wanted to bring that up...
Firefox: ProgramWizard's official web browser
Get Firefox
Spread Firefox
hi, i'm a signature viruz, plz set me as your signature and help me spread :)

#19 eddie

    Senior Member

  • Members
  • PipPipPipPip
  • 751 posts

Posted 28 December 2005 - 02:40 AM

[pedantic]
I've never heard of a "Masters in C++" myself, either.
[/pedantic]

#20 ProgramWizard

    Valued Member

  • Members
  • PipPipPip
  • 143 posts

Posted 28 December 2005 - 03:18 PM

eddie said:

[pedantic]
I've never heard of a "Masters in C++" myself, either.
[/pedantic]
Huh? I've heard of a Master's degree in C++...
Firefox: ProgramWizard's official web browser
Get Firefox
Spread Firefox
hi, i'm a signature viruz, plz set me as your signature and help me spread :)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users