Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
PHP Open Source Programming Software Upgrades

PHP 5.6.0 Released 118

An anonymous reader writes The PHP team has announced the release of PHP 5.6.0. New features include constant scalar expressions, exponentiation using the ** operator, function and constant importing with the use keyword, support for file uploads larger than 2 GB, and phpdbg as an interactive integrated debugger SAPI. The team also notes important changes affecting compatibility. For example: "Array keys won't be overwritten when defining an array as a property of a class via an array literal," json_decode() is now more strict at parsing JSON syntax, and GMP resources are now objects. Here is the migration guide, the full change log, and the downloads page.
This discussion has been archived. No new comments can be posted.

PHP 5.6.0 Released

Comments Filter:
  • by Joe Gillian ( 3683399 ) on Thursday August 28, 2014 @02:16PM (#47777705)

    Have they come up with another way to calculate the number of days between any given day and Easter yet? I've been waiting for years for a third function to be added to easter_days and easter_date.. a sort of holy trinity, if you will.

    • by Anonymous Coward

      you just use the baby_jesus_butthole function

      or was it jesus_baby_butthole? fuck ima need to check the manual

    • holy shit, I thought you were joking.
      • Nope! I don't code at all, but I had friends who coded pretty heavily in PHP and tried to learn it once. I spent a few hours one day looking at the list of functions included with PHP, and sure enough those two are in the official PHP documentation. To this day, I have no idea why they needed two built-in functions to determine when Easter was, or who it was they were expecting would use them... or why Easter, of all days.

        • I assume it is an ironic joke.

          Historically calculating the date of Easter was a hugely difficult and complicated task for medieval scholastic monks - one that involved a huge amount of time and controversy.

        • by pspahn ( 1175617 ) on Thursday August 28, 2014 @02:52PM (#47778051)

          Can you really not figure it out?

          First off, would it be quite easy for you to tell me off the top of your head what the date of Easter will be in 2021? How about just next year? The date it falls on it fairly complicated and not exactly simple to write an algorithm for.

          Ok, but who will use it? I guess it comes as a surprise that it is a fairly important holiday for religious reasons and that a number of other holidays' dates are intertwined with Easter.

          If you really see no practical application for that, well I guess you're just not trying hard enough.

          • the point is, they're built-in functions. Not a library or package, but part of the core language. What other language has a function (let alone two functions) to tell you when easter is?
            • by pspahn ( 1175617 )

              Sure, why not part of the core language? Think about it ...

              Out of all the holidays that I'm thinking of off the top of my head, Easter is the one that stands out as being of significant importance as well as being rather awkward to figure when it occurs. If you couple this with the fact that PHP is a web language (an environment where knowing when Easter is can come in rather handy) I think it makes perfect sense.

              I suppose if you're griping because there is no core method `ramadan_date` or `chinese_new_ye

              • by Anonymous Coward
                Why would you expect holidays to be part of the core package to begin with? The idea of that being where it belongs is stupid as hell.
        • I actually like coding in PHP. You can create some really nice applications using it. Then again, you can create really nice applications with just about any server side language if you know what you are doing.

          My main beef with PHP is the inconsistency with built-in function names. If you want to replace within a string, you use "str_replace", if you want to split a string into an array, you use "str_split". However, if you want to get part of the string, you use "substr". And if you want to compare tw

        • Maybe because it's a public holiday in some countries. Enterprisey stuff likes to know things like that.

          As to there being two, I understand that the benighted heathens of the Byzantine persuasion calculate it differently to the bead-jigglers in Rome.

          Then again, it's PHP so all bets are off.

    • It would be trivial to program your own function to do the same. Pseudocode shown below

      function daysToEaster($aDate) {
      var $nextEaster;

      if(aDate <= easter_date(year($aDate))
      $nextEaster = easter_date(year($aDate));
      else
      $nextEaster = easter_date(year($aDate) + 1);

      return floor($nextEaster - $aDate/(60*60*24));
      }

    • Omg I am a professional php developer I didn't even know these functions existed, I thought you were joking and had to look it up. Don't think I would ever have a use for them

    • by hholzgra ( 6914 )

      easter_days() plus fixed offset will get you a given years Ascension Day (easter_days+39, Withsunday (+49) etc.

      strictly speaking easter_date() is indeed redundant as you could as well use easter_days()+0, but its there as convenience function ...

      but as far as I remember the main reason for having both was that the C library the calendar extension relies on has both, too ...

  • by Anonymous Coward

    Great, what got deprecated? [goes to RTFA]

  • ... but, hey, we've got this major feature: you can now multiply two constants, and the result is also a constant! It's almost like C had in, what, 1985? Except that you don't actually need it because this is a dynamic weakly typed language, but who cares. PHP! PHP!

    • by tepples ( 727027 )
      How are mbstring and iconv not Unicode? Is it just that a byte order mark inserted by Windows Notepad will cause headers to be sent?
      • iconv lets you convert things, but what are you going to convert it to? UTF-8? Sure, and how many libraries (including core PHP ones) are UTF-8 aware? Most won't use mbstring, they'll just treat strings as arrays of bytes, and you're really lucky if they don't assume byte = char anywhere.

        Treating strings as 8-bit clean works well in some cases, but fails pathetically in so many others. Yet that is the game that PHP is trying to play.

  • by Aethedor ( 973725 ) on Thursday August 28, 2014 @03:18PM (#47778353)

    it's the cook that prepares the food. It's not the camera, it's the photographer that shoots the picture. It's not the racing car, it's the driver that wins the race. It's not the programming language, it's the programmer that creates the application.

    All you whiners can bash PHP like you want. But a PHP website will still beat your Perl website if the PHP programmer is better than you. So, unless your coding skills are 100% perfect, you better start looking at your own flaws instead of wasting time at whining about a programming language that simply isn't your pick of choice. Please, it's time to grow up.

    • by Ignacio ( 1465 ) on Thursday August 28, 2014 @03:40PM (#47778639)

      "... if the PHP programmer is better than you."

      For every good-to-excellent PHP programmer there is a small army of mediocre-to-bad PHP programmers. You get chefs that deep-fry rubber boots, photographers that can't tell the lens from the viewfinder, and drivers that can't put a car in gear without breaking something.

      But it also doesn't help when the programming language tells them that someone somewhere likes to eat overcooked footwear, or hands them a camera which is a featureless cube with two identical holes on either side, or takes away the gear shift and replaces it with a button labelled "Crash".

      • Thank you for proving my point.

        If you don't like PHP, that's fine. But please, stop wasting other people's time with your whining about it. Really, nobody cares!

        • by Ignacio ( 1465 )

          "Other" people's time? As far as I can tell, the only other person's time I'm wasting is yours. Want to go ballooning this weekend? We don't even need to bring fuel.

    • PHP is a very bad knife, and even a good cook can do a better (or easier) work when he have good knifes.
      • It's not a bad knife. It's just that *you* think that it's a bad knife. I think it's a fine knife. I'm not saying perfect, but no knife is. I know its good sides, I know its bad sides, which allows me to handle it well. The things I create with it are really up any challenge.

        But tell me, how's your cooking?

        • So I "think" that is a bad knife (from my experience using it on a big government system) and you thinks is a good knife[citation needed], so what? Is ony your opinion against mine, and I seriously doubt that your opinion carries more weight than mine only because you want so.
          • You're missing my point. I'm only saying: if you don't like it, don't use it. But don't bug other people with oppinion, because it's irrelevant to the .
            • Is irrevelant only for you. On my organization (and in many others, I can assure you) we care about the many opinions about a programming language when we are deciding which language to use in a given project.
              • Choosing a programming language that best suites the needs of your company it totally different from pointless bashing a programming language you don't even use. In that case, those opinions are irrelevant to everybody.
                • Sorry, you have problems with text interpretation? I made it clear that I work with the language on a pretty big system.
        • I code in PHP for my day job. There's almost nothing I can't do in PHP. Millions of people use my PHP code. I also know several other languages, so I have some basis of comparison to say PHP 5.0 kinda sucked as a general purpose programming language, and I can tell you exactly WHY it sucked.

          PHP was originally a blog / CMS script written in Perl. It was designed to be a blog, not language for general programming. In fact, it wasn't even supposed to be used by programmers at all. It was designed for web

    • it's the cook that prepares the food. It's not the camera, it's the photographer that shoots the picture. It's not the racing car, it's the driver that wins the race. It's not the programming language, it's the programmer that creates the application.

      Yes but a good cook will do better with a good knife, a good photog will be better with a good camera, and a good programmer will perform better with a well designed language.

    • Sure, but a programming language should not work AGAINST the programmer, and this is exactly what PHP does.

      Take a look at this page, and no, it's not an anti-php rant, but an overview of actual facts about PHP:

      http://eev.ee/blog/2012/04/09/... [eev.ee]

      I made a few PHP projects myself, but since I discovered Python and Django Framework, I would never go back to PHP again.
      • That's good for you, but it's still an opinion. I don't think that PHP works against the programmer. Talking about Django, I don't like it. I've takens a look at it, but I think it's too much hustle to get a simple website running. I've created my own framework, the Banshee PHP framework [banshee-php.org]. It's fast, secure and easy to use. The websites you can make with Banshee are just as good as the one you can make with Django.
  • by mr_mischief ( 456295 ) on Thursday August 28, 2014 @04:21PM (#47779017) Journal

    Here are the lines matching for grep -P 'CVE-\d{4}-\d+':

    Fixed bug #67390 (insecure temporary file use in the configure script). (CVE-2014-3981)
    Fixed bug #66060 (Heap buffer over-read in DateInterval). (CVE-2013-6712)
    Fixed bug #67716 (Segfault in cdf.c). (CVE-2014-3587)
    Fixed bug #67705 (extensive backtracking in rule regular expression). (CVE-2014-3538)
    Fixed bug #67327 (fileinfo: CDF infinite loop in nelements DoS). (CVE-2014-0238)
    Fixed bug #67328 (fileinfo: fileinfo: numerous file_printf calls resulting in performance degradation). (CVE-2014-0237)
    Fixed bug #67326 (fileinfo: cdf_read_short_sector insufficient boundary check). (CVE-2014-0207)
    Fixed bug #67410 (fileinfo: mconvert incorrect handling of truncated pascal string size). (CVE-2014-3478)
    Fixed bug #67411 (fileinfo: cdf_check_stream_offset insufficient boundary check). (CVE-2014-3479)
    Fixed bug #67412 (fileinfo: cdf_count_chain insufficient boundary check). (CVE-2014-3480)
    Fixed bug #67413 (fileinfo: cdf_read_property_info insufficient boundary check). (CVE-2014-3487)
    Fixed bug #66731 (file: infinite recursion). (CVE-2014-1943)
    Fixed bug #66820 (out-of-bounds memory access in fileinfo). (CVE-2014-2270)
    Fixed bug #66946 (fileinfo: extensive backtracking in awk rule regular expression). (CVE-2013-7345)
    Fixed bug #67060 (sapi/fpm: possible privilege escalation due to insecure default configuration). (CVE-2014-0185)
    Fixed bug #67730 (Null byte injection possible with imagexxx functions). (CVE-2014-5120)
    Fixed bug #66901 (php-gd 'c_color' NULL pointer dereference). (CVE-2014-2497)
    Fixed bug #66356 (Heap Overflow Vulnerability in imagecrop()). (CVE-2013-7226)
    Fixed bug #66815 (imagecrop(): insufficient fix for NULL defer). (CVE-2013-7327)
    Fixed bug #67717 (segfault in dns_get_record). (CVE-2014-3597)
    Fixed bug #67432 (Fix potential segfault in dns_get_record()). (CVE-2014-4049)
    Fixed bug #67539 (ArrayIterator use-after-free due to object change during sorting). (CVE-2014-4698)
    Fixed bug #67538 (SPL Iterators use-after-free). (CVE-2014-4670)
    Fixed bug #67492 (unserialize() SPL ArrayObject / SPLObjectStorage Type Confusion). (CVE-2014-3515)

    That's not the applications written in PHP, mind you. That's the language system.

    • by tepples ( 727027 )
      How many CVE fixes do you get in your typical web browser, or should I say client-side JavaScript language system?
    • ... consider this:

      How many people and projects use PHP? How many use another PL? How many fixes and updates would be in line for that other PL if it would have the same userbase. ... When did Ruby finally become UTF8 safe again?

      Make it work, then make it beautiful.

      If any PL incorporates this philosophy, it's PHP.
      And AFAICT they're doing pretty well following it, don't you think?

      My 2 cents.

  • I'm certainly biased because my company (ServerPilot [serverpilot.io]) sells a service for PHP developers using DigitalOcean and other servers, but it does seem like PHP is making great progress in the past few years both in the language and in terms of a strong developer community. We're very glad to see PHP 5.3 EOL'd recently. To encourage adoption of 5.6, we've already packaged and added support for 5.6.

There are two ways to write error-free programs; only the third one works.

Working...