Slashdot Mirror


An Early Look At What's Coming In PHP V6

IndioMan writes "In this article, learn about the new PHP V6 features in detail. Learn how it is easier to use, more secure, and more suitable for internationalization. New PHP V6 features include improved support for Unicode, clean-up of several functions, improved extensions, engine additions, changes to OO functions, and PHP additions." Update — May 7th at 16:47 GMT by SS: IBM seems to have removed the article linked in the summary. Here's a different yet related article about the future of PHP, but it's a year old.

8 of 307 comments (clear)

  1. So... by msh104 · · Score: 4, Informative

    without wanting to be overly sarcastic..

    What features are they gonne break this time?

    1. Re:So... by msh104 · · Score: 4, Informative

      At my work we host and have build and maintain a little over 200 php websites. We host them all ourselves. ( the CMS that we use is build in PHP )

      We earn money from both the hosting and the developing.

      Many of our customers don't want to pay for the porting of their websites to PHP5, let alone PHP6. usually this requires upgrading the CMS as well, making modifications to custom extentions written by outsourcing partys, etc. All in all quite expensive for the site owner.

      "Threatening" them with PHP4 server shutdowns only makes them go away to other hosting providers that will over PHP4 to them.

      So we ended up virtualising all the PHP4 sites together with a good backup system and making our customers understand that we provide no warrenty anymore. We will help them when things blow up on an paid per hour basis.

      Another problem is that we cannot reuse a lot of our code anymore now. Many of our new plugins require php5 so we have to modify them to make them php4 compatible again.

      when php6 comes out we will have to support three different php versions... the horrors of that vision already scare me today..

  2. Re:Hope it handles Search/Replace better by drpimp · · Score: 3, Informative

    Like any other computer science problem, break it into pieces (think Divide and Conquer). Loading 88MB file into memory is not going to work by default anyhow, unless you set the memory limit in PHP from the default you will get out of memory errors every time. I think even a find/replace in a Windows app like Notepad or Notepad++ will "work" but it will definitely be slow. When I used to search large logs I would use some sort of file splitter and search each file itself.

    --
    -- Brought to you by Carl's JR
  3. Re:question: by Anonymous Coward · · Score: 4, Informative

    Yes :(

  4. Re:One of these things is not like the OOthers by ABasketOfPups · · Score: 5, Informative

    Or...

    PHP:
    $myarray[] = $myvalue;

  5. New to this version by KingPin27 · · Score: 3, Informative

    they have actually turned off the register_globals feature (really this time it won't work). If you try to use it you get an error message that says RTFM (ERROR: ID-10-T)

    --
    "i lost my dignity on a slippery wiener"
  6. Broken Link in Summary by Udigs · · Score: 5, Informative
  7. Re:Finally by dgatwood · · Score: 3, Informative

    PHP is much, much closer to C than C++ with truckloads of STL piled on top. Ask a C programmer to comprehend that mess and you'll likely have a suicide on your hands. It is very un-C-like. The point is that the PHP syntax for arrays is very nearly identical in behavior and syntax to C, just with lots of extra functionality (variable length associative array). I never said that C++ couldn't do those things, but as far as I've seen, when you do it in C++, you're generally way off the deep end as far as being syntactically familiar to C programmers.

    I guess what it comes down to is this: if you think templates are elegant, then we will never agree about what makes a good language design. From my perspective, templates are what happens when somebody forgets that we have a perfectly good C preprocessor and decides to reinvent the wheel with a clumsy syntax that doesn't provide anything more than what C preprocessing could already provide, wedging the concept into the language itself for no apparent reason. It is anathema. It is absolutely the antithesis of good language design.

    As for OO in PHP, I don't see why you think dynamic typing decreases the value of object-oriented programming. If you really are mostly using the same code with different underlying types, then there's little point in doing OO, but in my experience, that's the exception rather than the rule. Most of the situations where I've used OO with polymorphism, I've had polymorphism, but the underlying implementation has differed substantially, and the only thing similar was the method name (and the general concept for what the function does).

    Also, it is nice to use classes even when you don't need polymorphism. This reduces pollution of the global function namespace. It also makes it easy to create complex data structures that make life easier. (PHP doesn't have the notion of a struct, so you have to either use a class or an associative array.)

    Finally PHP is still very much a typed language. It's not like there is no notion of types and everything is polymorphic with everything. The type of a variable is determined when the variable is assigned, and some types can be coerced into other types in certain use cases, but it isn't universal. I can't do if ($arrayA < $scalarB), for example. PHP even has the notion of casting to force type conversion just like you do in C. For example:

    function myfunc($mynumber) {
    $mynumber = (int)$mynumber;
    ...
    }

    Dynamic typing doesn't mean the types aren't there. If you call a method on an object that doesn't exist on that object, it is still an error. And so on. Dynamic typing just makes it a little easier to shoot yourself in the foot by not throwing up an error when you make the assignment or function call in the first place. :-)

    --

    Check out my sci-fi/humor trilogy at PatriotsBooks.