Stories
Slash Boxes
Comments

SoylentNews is people

posted by janrinok on Thursday June 25 2015, @12:54PM   Printer-friendly
from the almost-ready dept.

Although the first alpha build of PHP7 was released just two weeks ago, the second build is already being rolled out. A variety of issues from 5.6 have been fixed as part of version 7's alpha build, and a rather comprehensive overview of new features and other language changes have been posted on PHP's official GitHub repository. Some of the most notable improvements are the boasted performance enhancement over PHP5.6, claimed to be up to twice as fast on 64-bit systems, and the well-debated inclusion of scalar type hints.

Additional history of the drafted and implemented changes for version 7 can be seen at the PHP Request for Comments Wiki.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by MichaelDavidCrawford on Thursday June 25 2015, @01:40PM

    by MichaelDavidCrawford (2339) Subscriber Badge <mdcrawford@gmail.com> on Thursday June 25 2015, @01:40PM (#200943) Homepage Journal

    It's not that I regard PHP as a bad language. Rather it gets that reputation because it is favored by clueless newbies.

    --
    Yes I Have No Bananas. [gofundme.com]
    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 0) by Anonymous Coward on Thursday June 25 2015, @02:05PM

    by Anonymous Coward on Thursday June 25 2015, @02:05PM (#200953)

    Wasn't that the case with Java and C++ at some point?

    • (Score: 3, Interesting) by MichaelDavidCrawford on Thursday June 25 2015, @02:43PM

      by MichaelDavidCrawford (2339) Subscriber Badge <mdcrawford@gmail.com> on Thursday June 25 2015, @02:43PM (#200977) Homepage Journal

      A client asked me to figure out why his server kept crashing. Youre running out of swap spave because of memory leaks in your java app. But thats not possible java has garbage collection. That because suns marketing people lied to you.

      I set up a cron to reboot every night.

      Bjarne intended for c++ to solve many problems but for that to happen you have to write c++ the way it is meant to be written.

      mike whats that there in your source. its an initialization list. whats that? it enables transactional commit rollback object initialization.

      100 programmer years in a single executable and they had never even heard of initialization lists.

      Mentor Graphics adopted c++ because object oriented code is reusable. what they got was a clusterfuck. good assembly is reusable but bad c++ is not.

      --
      Yes I Have No Bananas. [gofundme.com]
      • (Score: 2) by M. Baranczak on Thursday June 25 2015, @07:12PM

        by M. Baranczak (1673) on Thursday June 25 2015, @07:12PM (#201169)

        Youre running out of swap spave because of memory leaks in your java app. But thats not possible java has garbage collection. That because suns marketing people lied to you.

        Did anyone from Sun ever actually claim that memory leaks are "impossible" in Java (as opposed to "much less likely")? Or did you just make that up?

        • (Score: 2) by MichaelDavidCrawford on Thursday June 25 2015, @07:29PM

          by MichaelDavidCrawford (2339) Subscriber Badge <mdcrawford@gmail.com> on Thursday June 25 2015, @07:29PM (#201184) Homepage Journal

          I dont know about sun specifically but java fans iften make that claim.

          optimize-it was a java leak detector that borland sold for thousands of dollars per license.

          i dont regard java as being less likely than C++ to leak. it's easy to write leak free c++.

          --
          Yes I Have No Bananas. [gofundme.com]
          • (Score: 2) by fleg on Friday June 26 2015, @02:56AM

            by fleg (128) Subscriber Badge on Friday June 26 2015, @02:56AM (#201363)

            >i dont regard java as being less likely than C++ to leak.

            wow, my bind is moggled.

            >it's easy to write leak free c++

            "easy"? do tell

            • (Score: 2) by MichaelDavidCrawford on Friday June 26 2015, @10:14AM

              not that one cannot write leak free java but that java is harder to get right.

              http://www.warplife.com/tips/code/c++/memory-management/parameters/ [warplife.com]

              --
              Yes I Have No Bananas. [gofundme.com]
              • (Score: 2) by fleg on Sunday June 28 2015, @02:27AM

                by fleg (128) Subscriber Badge on Sunday June 28 2015, @02:27AM (#202305)

                funny. so which bit of that would cover "it's easy to write leak free c++"? operative word being "easy". because "easy" does not mean "this really is a complicated and detailed topic, and I worry that I will scare away beginners." which is from your own intro.

            • (Score: 2) by TheRaven on Friday June 26 2015, @12:08PM

              by TheRaven (270) on Friday June 26 2015, @12:08PM (#201471) Journal
              It actually is much easier to write leak-free C++ with C++14 than it used to be. Basically, never keep bare pointers around and, if you're allocating objects on the heap, always use std::make_unique or std::make_shared. Avoid cyclic data structures (this is probably the hardest. When you have to have cycles, explicitly break them with std::weak_ptr).
              --
              sudo mod me up
              • (Score: 2) by fleg on Sunday June 28 2015, @02:32AM

                by fleg (128) Subscriber Badge on Sunday June 28 2015, @02:32AM (#202308)

                interesting, i havent been keeping up with c++ (all my experience is pre c++11) so i hadnt come across those make_ functions before. thanks.

                • (Score: 2) by TheRaven on Monday June 29 2015, @08:49AM

                  by TheRaven (270) on Monday June 29 2015, @08:49AM (#202701) Journal
                  If you haven't looked at C++ since before C++11, then I'd suggest taking another detailed look. The language now doesn't completely suck. It's now possible to write quite nice code in C++ (the problems with ABI fragility are still there, sadly). With shared_ptr and unique_ptr, lambdas, the threading and atomics libraries, it has many of the features that you actually want from a modern language. I've gone from hating C++ to tolerating it and using it as my default language for new projects as a result. There's absolutely no way that I'd contribute to a pre-C++11 codebase now though.
                  --
                  sudo mod me up
  • (Score: 2, Insightful) by mechanicjay on Thursday June 25 2015, @02:11PM

    I mostly agree. It's not hard to write well-structured lucid php. There are some really infuriating language features, mostly surrounding inconsistencies in the handling of NULLs and Boolean values, but there are worse things. Mostly I find it flexible, performant, with enough standard libraries that I'm not reinventing the wheel for mundane tasks.

    Of all the things that I pick up to maintain from others, give me a PHP app any day. Ruby on Rails apps are impenetrable to my brain, and the pile of perl scripts I've inherited at work sometimes make me hurt.

    --
    My VMS box beat up your Windows box.
  • (Score: 4, Insightful) by Thexalon on Thursday June 25 2015, @02:48PM

    by Thexalon (636) on Thursday June 25 2015, @02:48PM (#200983)

    By contrast, I regard it as a terrible language that has been polished to the point where it doesn't look quite as bad.

    It hasn't just been favored by clueless newbies over its entire existence, it was cobbled together by an admitted clueless newbie for an intended audience of clueless newbies. For comparison's sake, look at Basic and Pascal for languages designed by experts with an audience of clueless newbies in mind.

    The classic PHP: A fractal of bad design [eev.ee] lays out a large number of examples of how PHP got things horribly horribly wrong.

    The one that bothers me the most: There is absolutely no consistency about what happens when something goes wrong. The possibilities I've encountered in recent 5.x versions include:
    A. An exception is thrown back up the call stack.
    B. An error is fired off, which can go to an error_handler function if you define one somewhere.
    C. The function returns a result which indicates that an error occurred, which may or may not be also a valid result for that function call. (And even if it's not a valid result from that function call, it may be indistinguishable from a valid result if you use "==" instead of "===".)
    D. The error is ignored and PHP tries to continue as if nothing went wrong, with some variables set to null or something.
    E. The function returns what appears to be a valid result, but what you expected to happen didn't actually happen, so you need to call a separate error-checking function to see if something silently went wrong.
    F. A fatal error occurs that crashes your program immediately, with no opportunity to do anything about it. Information about what went wrong may be logged somewhere if you're lucky.
    G. The process running PHP (either "php" on the command line or the Apache process if using mod_php) seg faults and is killed with no error information whatsoever.

    Contrast this to the wide range of possibilities in Python, Ruby, Java, and a bunch of other languages:
    A. An exception is thrown up the call stack.

    That sort of thing is not the fault of the developers using the language, that's the fault of the language. And it's definitely the fault of the language that there was no specification whatsoever until late July of last year (the language has been in use since 1995). Libraries like Zend and Kohana have done a fairly good job of covering up the more egregious flaws, but that doesn't excuse the language developers. Its popularity now rests entirely on its popularity in 1998 or so, and also rather heavily on the popularity of Wordpress because a lot of businesspeople don't know that other content management systems exist.

    --
    The only thing that stops a bad guy with a compiler is a good guy with a compiler.
    • (Score: 2) by MichaelDavidCrawford on Thursday June 25 2015, @03:32PM

      by MichaelDavidCrawford (2339) Subscriber Badge <mdcrawford@gmail.com> on Thursday June 25 2015, @03:32PM (#201017) Homepage Journal

      ill informed businessmen also lead to the notion that java was suitable for croos platfor development.

      --
      Yes I Have No Bananas. [gofundme.com]
      • (Score: 1, Insightful) by Anonymous Coward on Thursday June 25 2015, @05:01PM

        by Anonymous Coward on Thursday June 25 2015, @05:01PM (#201071)

        It's not? Or are you just thinking of a handful of use-cases where it doesn't make sense and ignoring the literally millions of examples where Java works just fine cross-platform?

  • (Score: 1) by ghost on Thursday June 25 2015, @02:59PM

    by ghost (4467) on Thursday June 25 2015, @02:59PM (#200994) Journal
    it was built by people that don't know anything about languages. I'm not saying you need a PhD in programming languages (that leads to shit like haskell) but you need a certain level of competence. Sometime around PHP 5, it started getting better, but there's still a legacy of shit underneath. And it can never be cleaned up because somewhere, somebody is depending on it.
    • (Score: 2) by mechanicjay on Thursday June 25 2015, @04:01PM

      Sometimes a lesser product succeeds where a better product fails.

      History is chock full of such examples. What I've observed over the last 10 years, is that as newer languages have a meteoric rise and subsequent fall, PHP seems to be consistently popular. Sure there are Ruby sites, and Django sites, and .net sites and .jsp sites, but the fact is that PHP runs a huge percentage of the web quite competently. Perhaps this is aided by the fact that it's dead-nuts simple to get something serving a php site, or that its also simple to get PHP sites to scale, or there is just a really low barrier to entry -- perhaps some magic combination there of.

      Is it the Lowest Common Denominator of web programming languages? Probably.
      Is that necessarily a bad thing? I don't think so.

      --
      My VMS box beat up your Windows box.
  • (Score: 2) by TheRaven on Friday June 26 2015, @12:06PM

    by TheRaven (270) on Friday June 26 2015, @12:06PM (#201470) Journal
    There are many bad things about PHP. My favourite is that "0xff" == "255" evaluates to true. It's sort-of nice that you can do this kind of coercion, but it's led to some quite interesting bugs in comparing credit card numbers, where the comparisons were truncated to a floating point value and then compared numerically, rather than as string comparisons.
    --
    sudo mod me up