Forgot your password?

Close
This discussion has been archived. No new comments can be posted.

PHP 5.2.0 Released More Login

PHP 5.2.0 Released

Comments Filter:
  • All
  • Insightful
  • Informative
  • Interesting
  • Funny
  • Oh look... (Score:1)

    by urbanradar (1001140) writes:
    ...a PHP story!

    "PHP is a toy language" trolls in 3... 2... 1...
    • Argh. (Score:5, Insightful)

      by Balinares (316703) writes:
      Urbanradar,

      Your comment pisses me off, but there's something I want to say all the same: I think you are, essentially, right. Whatever one's woes with PHP might be, they don't justify trolling and unsubstantiated mouthing off. Besides, "toy language" is a purely inflammatory statement that doesn't even have any factual content.

      However.

      However, the implicit underlying assumption I think I perceive in your comment -- that PHP criticism must be trolling -- annoys me a lot. Please allow me to expand on this.

      You
      • Arghmen (Score:5, Interesting)

        by Bogtha (906264) writes:

        I think this is what people mean when they call the management and design of the PHP language 'amateurish'. Blatant lack of good engineering practice.

        Totally agree 100%. Another example: did you ever use nl2br() [php.net] to convert newlines into <br> elements? It's an extremely common thing to do. In a minor patch release, they changed the function to generate XHTML instead of HTML. In one stroke, everybody who thought they were generating valid HTML had errors in their code. This might not sound th

        • Re:Arghmen (Score:5, Interesting)

          by nuzak (959558) writes: on Friday November 03 2006, @10:57AM (#16703529) Journal
          Amen to the cavalier attitude. You know about PHP's Javascript-esque === operator? (that's the one with three equals signs). That got designed on the spot in an IRC session with Zeev and some other devs. Because I actually had to explain to these folks what the concept of "object identity" was, i.e. what lisp does with 'eq', python does with 'is', and Javascript does with ===. Yes, because PHP's is different. Not only does === fail to do object identity testing, it's simply '==', does all the "deep comparison" of ==, but also bothers to compare the type.

          In other words, I was unsuccessful in explaining this rather basic concept. They got it blisteringly wrong, and hacked this wrongness into the language for all time. I attempted to explain (much more patiently than here) that no, this is not what === is supposed to do, but I wasn't heard. Not by Zeev, not by anyone else on channel. No one got it at all.

          I passionately hated PHP for a long time after that, but it's just not relevant enough to my work anymore to hate. I have choices, I don't have outside clients demanding I use PHP anymore, and my choice of languages is respected where I work. I've chosen python for some projects, perl for another, C++ for another (the C++ one was of course not web). I could probably write my next project in Haskell and no one would bat an eye (though I will be stuck with maintaining it for all eternity). I'm even eying Prado -- a PHP library -- for an upcoming project, though I've still no desire whatsoever to write actual business logic in PHP, so it'll have to be solely at the view end of things.
          Parent Share
          twitter facebook
          • Re: (Score:2)

            by merreborn (853723) writes:
            In PHP's defense, it is desperately in need of the current functionality of ===, because 0 == false, and there are core PHP functions that return *both* 0 and false (which mean entirely different things, in context). As such, you're left in a situation where you must use PHP's === to tell which one exactly the function gave you.

            An object identity comperator is all good and fine, but PHP needed this functionality much more desperately.

            At any rate, I can't disagree with the perception of ineptitude on the pa
            • Re: (Score:2)

              by nuzak (959558) writes:
              I looked at the bug, and it appears that it's gc'ing as expected, but doesn't let the OS reclaim the extra heap. This is pretty much to be expected, almost all language runtimes behave this way. Heck, most virtual machines like Java or Smalltalk allocate a fixed heap right off the bat.

              Perl also has the batty notion of "scalars" and as a result believes that a zero in a string is false, and makes string comparisons really hell with its own insanity around 'eq' ... though Perl's also not in the habit of pas
              • Re: (Score:2)

                by TheLink (130905) writes:
                Question: what's wrong with string comparisons and eq in perl? Examples please if possible.
                • Re: (Score:2)

                  by nuzak (959558) writes:
                  Strings are only comparable for string equality with 'eq'. The == operator compares only numeric equality, and the numeric value of any string that doesn't look like a number is, in fact, zero.

                  $ perl -le 'print "matches" if "foo" == "bar"'
                  matches


                  If you use -w or "use warnings", which any sane person should do, you get a warning about it. That perl's scalar type lets you play fast and loose with strings and ints with is fine for one-offs, but there's no flag or pragma that actually separates strings and in
                  • Re: (Score:2)

                    by TheLink (130905) writes:
                    But that's not a problem, that is a correct way to do things. Perl is intentionally weakly typed.

                    If you want to have weak typing and compare stuff then when you want to compare different types of stuff with each other, you need different operators/functions depending on what sort of comparisons you want to do. The alternative is to be verbose and convert stuff before comparing.

                    Maybe not the only correct way, but definitely better than PHP's way - where they didn't seem to think about the implications of wea

Trying to define yourself is like trying to bite your own teeth. -- Alan Watts

gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.