Slashdot Mirror


PHP 5.5.0 Released

New submitter irventu writes "The long-awaited PHP 5.5.0 has finally been released, bringing many new features and integrating Zend's recently open-sourced OPcache. With the new Laravel PHP framework winning RoRs and CodeIgnitor converts by the thousands, Google recently announcing support for PHP in its App Engine and the current PHP renaissance is well underway. This is great news for the web's most popular scripting language." The full list of new features is available at the Change Log, and the source code is at the download page.

22 of 219 comments (clear)

  1. PHP 6.0 without the stupid? by Anonymous Coward · · Score: 5, Insightful

    I'm still waiting for a PHP 6.0 that's an actual rewrite without all the stupid. With every new version, I just see more features get tacked on ("Objects").

    It's wonderfully backward compatible because nothing really gets removed in newer versoins, but it would be nice if the language could be made more pleasant to use.

    1. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 5, Informative

      The thing that bothers me most is the inconsistency in function names or argument order. When I'm using PHP, I have to constantly keep looking the functions up to make sure its doing what I expect.

    2. Re:PHP 6.0 without the stupid? by squiggleslash · · Score: 5, Funny

      what_have youGot AGAINST $_THEWAY PHP works($dummy, WORKS_TODAY)? I think it's==great, wait, sorry I mean "I think it's===great." - I accidentally passed in null and that last condition gave me a bunch of false positives.

      I'm hoping PHP6 will finally give programmers the ==== and ===== operators we've been waiting for.

      --
      You are not alone. This is not normal. None of this is normal.
    3. Re:PHP 6.0 without the stupid? by gmack · · Score: 5, Insightful

      Because then some people would have to stop updating? The place I work has code dating back 10 or 11 years and the programmers already have to go through the code each update to see what got dropped and even then there will be demands for the upgrade to be rolled back or "delayed" (moved to a point in the future that never happens because they never have time for it).

      It's not just in house stuff that doesn't update either, Check out large Open source projects and see how many of them generate warnings related to deprecated functions.

      If you want a language that has no cruft there are languages you can switch to but not many people use them for the reasons stated a above.

    4. Re:PHP 6.0 without the stupid? by gbjbaanb · · Score: 4, Funny

      so do I.. but then, I'm old and I have to do that for everything. Maybe its not the language after all.. just saying :-)

    5. Re:PHP 6.0 without the stupid? by i_ate_god · · Score: 4, Informative

      == and === are common in dynamically typed languages

      assert 1 == true //works
      assert 0 == false //works
      assert 1 === true // fails
      assert 0 === false // fails

      --
      I'm god, but it's a bit of a drag really...
    6. Re:PHP 6.0 without the stupid? by kbolino · · Score: 4, Insightful

      Indeed, but the problem is type coercion and not dynamic typing. You can have a dynamically typed language that does not coerce unlike types to make life "easier".

    7. Re:PHP 6.0 without the stupid? by Samantha+Wright · · Score: 4, Informative
      --
      Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
    8. Re: PHP 6.0 without the stupid? by thetoadwarrior · · Score: 4, Insightful

      This is one of the biggest problems. It's a horrible language to look at. The carelessness carries through the community too. You simply can't trust third party to be anything but amateur. But who can blame PHP devs when the core language is cack and the documentation is laughable.

    9. Re: PHP 6.0 without the stupid? by Bert64 · · Score: 4, Insightful

      Part of the problem with PHP is that it's designed to be simple to pick up... Many people start by just adding one or two simple PHP tags to an existing HTML file and go from there.

      No need to learn a development environment, no need to create archives or packages, quite literally anyone can create their first "dynamic" webpage by adding one line of php to an existing html file, many people do something really simple like just show the current time etc.

      This accessibility has a price, because php is accessible to people with little or no experience of writing code, then lots of such people use it and this often results in very poor code. It's perfectly possible to write very clean code with PHP, you just have to look for it amongst all the thousands of novice programmers turning out junk.

      --
      http://spamdecoy.net - free throwaway anonymous email - avoid spam!
    10. Re:PHP 6.0 without the stupid? by squiggleslash · · Score: 4, Insightful

      While that's true, the complaint isn't that PHP has a dynamic typing system and has some operators that reflect that, it's that the coercion and comparison rules are... not exactly easy to predict. Not to mention the fact === works the way you'd expect == to work, with == performing non-intuitive coercion to try to find a way to make different things the same.

      assert(""==false);
      assert(0==false);
      assert("0"==false);
      assert(null==false);

      All of these will succeed.

      * Intuitively to a non-PHP programmer, only the second one should.
      * A PHP programmer with experience will, on the other hand, note that given "echo 1==2" products no output, only the first should be guaranteed to succeed with the second one maybe kinda succeeding.

      The others? Dubious at best. The third should always fail, because "0" != "false" and "0" != "" (but PHP is doing the wrong coercion so it instead converts the string to a boolean rather than vice-versa), the fourth treats null in a way that almost makes SQL look logical.

      Ironically, your observation makes my joke more accurate than originally intended. Given the behavior of == is not what's needed in a dynamically typed, softly typed, language, and === provides only one of the legitimate comparison operators necessary for such a language, we do, actually, need an ==== operator in PHP. Scary, huh?

      --
      You are not alone. This is not normal. None of this is normal.
    11. Re: PHP 6.0 without the stupid? by garyebickford · · Score: 4, Informative

      Ha. As a programmer in at least two handfuls of languages over 40 years from IBM 1130 ASM, FORTRAN, ALGOL 68, Pascal, Basic (ick), APL, etc., and long time programmer in PHP, I am presently in the process of hacking up someone else's Perl.

      Nobody who writes in Perl can have anything to say about the structure, style or consistency of PHP. PHP may have grown like topsy and it could certainly use some revision of function argument order, but it at least uses a syntax that is remotely similar to other common imperative languages - java, c, etc. From my first look at Perl in 1995 I always thought Perl looked like sneezing, and now I'm working with it, my first impression was correct. (Although in fairness I use PCRE in PHP quite a lot!)

      This is my most recent 'fave' quote from perlsyn - on 'when', which is part of Perl's attempt to rethink (or something) the switch/case pattern:

      Exactly what the EXPR argument to when does is hard to describe precisely, but in general, it tries to guess what you want done. Sometimes it is interpreted as $_ ~~ EXPR, and sometimes it does not. It also behaves differently when lexically enclosed by a given block than it does when dynamically enclosed by a foreach loop. The rules are far too difficult to understand to be described here. See Experimental Details on given and when later on.

      Pathologically Eclectic Rubbish Lister indeed!

      Since I'm on a role here, I will complain about one thing in Python, though I've only programmed a bit in Python. Python's much vaunted 'indent' based nesting is a mistake, because it only uses one invisible marker (which may be instantiated by several symbols - spaces and tabs, at least) to do this. All other common languages I can think of use different markers for begin and end, which acts as a kind of 'double entry bookkeeping' for the parser. Without a closing marker, Python's parser has no way to catch errors in leading spaces.

      A similar type of error results from C's syntax, which was unfortunately adopted in PHP - in allowing action inside a conditional "if ($foo = 1 + $bar)", the poor parser has no way to know if one really means 'compare' or 'assign'. This is the cause of innumerable bugs in both languages. This could be fixed by requiring assignments inside a conditional to be surrounded by block markers: "if ({$foo = 1 + $bar})".

      But I like all 'scripted' languages better for my purposes (entirely applications, no device drivers or kernel work) than C and other 2nd generation languages. I've had exactly one segfault working with PHP, in nearly 20 years.

      --
      It's easier to be a result of the past, but more fun to be a cause of the future! http://www.spacefinancegroup.com/
  2. Bugs & Maintainers by TheNinjaroach · · Score: 4, Informative

    I participated in beta release testing for 5.5 and I'm frustrated that it still has old bugs that cause segfaults that continue to go ignored by the maintainers. I even supplied the patch and submitted a Github pull request, but the maintainers continue to ignore it.

    It's no fun having to keep our own custom patchsets for PHP just to keep it running properly.

    --
    I went to eat some animal crackers and the box said, "Do not eat if seal is broken." I opened the box and sure enough..
    1. Re:Bugs & Maintainers by Grashnak · · Score: 5, Funny

      Fork it?

      Shame on you for harming future generations of girl coders! I must tweet your picture and publicly shame you!!!!

      --
      Life needs more saving throws.
  3. Citation needed by benjymouse · · Score: 4, Insightful

    With the new Laravel PHP framework winning RoRs and CodeIgnitor converts by the thousands

    Citation needed. Why does the summary contain this blurb which is not even relevant to the story. Me suspects that the submitter could be an advocate who just ceased on an opportunity to tell slashdot about his favorite PHP framework.

    --
    Reading slashdot one-liner: (irm http://rss.slashdot.org/Slashdot/slashdot).rdf.item | fl title,desc*
  4. Not even trying to be statically safe by Anonymous Coward · · Score: 4, Interesting

    You only need a peek to see this Laravel dubbed "PHP renaissance" does not even try to be statically safe. It's littered with pitfalls like writing your validators with strings, such as: "array('name' => array('required', 'min:5')), ...".

    (It is possible to write statically typed validators, with clean syntax (depending on language) and you end up not loosing stuff like auto-completion, semantic checking by IDE etc. See for instance latest Scala PlayFramework and it's JSON validation, it is relatively easy to use, and syntax is surprisingly succinct taken the fact it's extremely type-safe.)

  5. Really? by LizardKing · · Score: 4, Insightful

    With the new Laravel PHP framework winning RoRs and CodeIgnitor converts by the thousands

    Citation please.

    1. Re:Really? by Chris+Mattern · · Score: 4, Funny

      Citation please.

      Okay. How's this?

  6. Yeah, I'm sure by Trailer+Trash · · Score: 4, Insightful

    With the new Laravel PHP framework winning RoRs and CodeIgnitor converts by the thousands...

    CodeIgnitor? Maybe. RoR? Um, no. Or, perhaps, in your dreams.

    As an RoR developer who left PHP years ago I assure you - we aren't just waiting for a really good PHP framework that's an RoR knockoff. Part of the greatness of Rails is Ruby, and looking through the Laravel docs just confirms that. It looks like Laravel is about as nice as you can get on PHP, but ultimately it's still PHP underneath (and on top).

    Rails is a meta-language built on top of Ruby. Just can't do that in PHP.

    And that's not even getting into the ugliness of PHP's cruft that's been built up over the years.

  7. A public thank you to the PHP team by Boss,+Pointy+Haired · · Score: 5, Insightful

    Yes it has its flaws, yes you sometimes don't know whether you're looking for needles in haystacks or haystacks in needles, but it's not like they're not aware of that, and it's not really a big deal either in these days of syntax and function aware editors and instant online reference, and it has provided me and i'm sure many thousands of other people with a career not just in contract coding but also in being used almost exclusively on our own websites.

    Thanks guys!

  8. Guilty pleasures by EmperorOfCanada · · Score: 5, Interesting

    I have two guilty pleasures: Watching the show COPS, and programming in PHP.

    I dream about getting away from PHP and occasionally dip my toes in other waters (Python, Java, and even C++) but always come back to PHP. I won't go to Ruby for as many websites start with Ruby and then abandon it for many other languages. People blah blah about MVC but often what I am doing is just too damn simple to need such added complexity. I might need a program that I occasionally run to view a list of spam flagged submissions; it is done in 10 minutes in PHP. I don't use any frameworks and am diligent enough to keep things running through prepared statements and whatnot. With opcode caching and memory caching of data PHP is very very fast.

    It is not so much that PHP is the best at anything it is that it isn't really terrible at anything I care about. Almost every other language is terrible at at least one thing that I do care about.

    Personally I think that PHP gets its bad rap because it is a very easy transition from HTML. So you have basically non programmers starting to sprinkle PHP into their HTML and oddly enough an untrained programmer's first efforts end up being crap. Then because PHP covers all the web server basics these programmers potentially never venture beyond PHP and there is nothing better for making a bad programmer than a one language programmer. (Not someone who primarily programs in one language but one who only ever learned the one language) So these same programmers keep expanding the scope of their terrible code.

    So if anyone can suggest a programming language to replace PHP I would love to know (and all JVM languages are off my list).

    1. Re:Guilty pleasures by Samantha+Wright · · Score: 5, Informative

      There are a lot of very real technical reasons why people don't like PHP. The syntax and naming of its function library is inconsistent, the type coercion is irregular, and it's inconsistent about warnings vs. errors—it tends to keep executing code even when it shouldn't, potentially leading to unwanted behaviour during development if a variable isn't set or something. Reddit has a fairly active board devoted to the various problems that can occur, not all of them avoidable.

      One of the most peculiar details in all of this is that PHP's original author (and, I think, but don't quote me on this, a portion of the development staff) considers himself a non-programmer; that PHP was just thrown together to simplify work. That would be okay, but it's led to a lot of security holes, bugs, and irreversible bad choices over the years, like having to use === in string parsing because false is returned by strpos() if it doesn't find anything (and false == 0). No other language requires this particular quirk.

      I don't blame you for not liking Ruby. While it's a much cleaner language, it's got some very peculiar syntactical features that make a lot of people scratch their heads—most notably, there are circumstances under which return doesn't work normally, which can be very frustrating. However, there are some very creative uses of familiar syntax that, for example, make strings really easy to work with; haystack['needle'] = 'thread' is the same as $haystack = str_replace('needle', 'thread', $haystack) in PHP. I haven't used it personally, but I think the major reason Ruby projects get abandoned so much is because the people writing code in it are not experienced programmers.

      Running down the list a little and hopping over JVM stuff, the other decent web languages you may want to consider are Perl and Python. Both have extremely well-developed libraries and are good with strings, so it's mostly just a question of picking "esoteric and terse" vs. "newbie-friendly and easily maintained." Decent JVM languages include JWT, Scala, and Clojure (with noir; check out that sexy beast), although JWT is probably overkill for anything smaller than Gmail.

      --
      Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!