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.

307 comments

  1. Finally by Anonymous Coward · · Score: 2, Insightful

    It's about time PHP has native support for unicode.

    1. Re:Finally by sopssa · · Score: 4, Interesting

      One thing I hope PHP would have is GUI stuff for both Windows and Linux. Its a great language for everything, and I use it constantly for scripts and other stuff. I've even written ircbots and servers with it, and they all work great and are nice to work with.

      However the GUI design with the existing tools is just pain in the ass, and it doesnt offer a good way to turn your code into machine code.

      I do understand that theres programming languages like c/c++ and delphi and several others, but from all of those php is the nicest to use, even for non-webpages stuff.

      I dont think it would be that hard to implement such, given theres people to do it and understand how PHP can be greatly used for non-webserver stuff aswell. Or is there something against it that I havent thought of?

    2. Re:Finally by VagaStorm · · Score: 1

      $output = fopen('outputfile.txt', 'wt');
      fwrite($fp, $uni); // writes out data in UTF-8 encoding

      ..... not where you expect it it dossent....

    3. Re:Finally by ShawnCplus · · Score: 2, Insightful

      There is the PHP GTK project but I'm a PHP developer and even I'm wondering why you would choose PHP for developing a GUI desktop app.

      --
      Excuse me while I gather the virgin sacrifice and assemble the pentagram required to solve your problem
    4. Re:Finally by joss · · Score: 1

      Funny, very very dry, but damn funny.

      --
      http://rareformnewmedia.com/
    5. Re:Finally by ShawnCplus · · Score: 1

      haha, nice catch

      --
      Excuse me while I gather the virgin sacrifice and assemble the pentagram required to solve your problem
    6. Re:Finally by maxume · · Score: 1

      Where did $fp come from?

      Or is PHP even crazier than I thought?

      --
      Nerd rage is the funniest rage.
    7. Re:Finally by RichardJenkins · · Score: 1, Informative

      Interesting thought. Does anyone use PHP for anything other than its ubiquity?

    8. Re:Finally by rho · · Score: 4, Insightful

      Ubiquity is a pretty compelling feature.

      I mean, BeOS is pretty bitchin', but I'm not spending any of my time on developing applications for it.

      --
      Potato chips are a by-yourself food.
    9. Re:Finally by clone53421 · · Score: 4, Funny

      Too bad Slashdot still wonâ(TM)t.

      I mean, won't.

      --
      Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
    10. Re:Finally by ShawnCplus · · Score: 1

      It's a fatfinger by TFA writer. $fp doesn't exist, it should be $output.

      --
      Excuse me while I gather the virgin sacrifice and assemble the pentagram required to solve your problem
    11. Re:Finally by dgatwood · · Score: 4, Interesting

      Because it's syntactically similar to C. It's remarkably close to what C++ should have been---C with classes, integrated hashes, variable-length arrays, and usable string manipulation. Thus, for long-time C programmers, it's a very natural language to pick.

      --

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

    12. Re:Finally by maxume · · Score: 1

      Ah. I only skimmed the article and failed to figure out the context.

      --
      Nerd rage is the funniest rage.
    13. Re:Finally by ShawnCplus · · Score: 3, Interesting

      I've programmed in both C and C++ and I've used PHP GTK and I'd choose X86 Assembler to build a GUI before I choose PHP for desktop GUI development. And all of the benefits you mentioned are almost completely alleviated with Boost

      --
      Excuse me while I gather the virgin sacrifice and assemble the pentagram required to solve your problem
    14. Re:Finally by master5o1 · · Score: 1
      --
      signature is pants
    15. Re:Finally by Yvan256 · · Score: 2, Funny

      But you can use Boost with any language, I don't see your point.

    16. Re:Finally by Yvan256 · · Score: 5, Funny

      That's so cliché.

    17. Re:Finally by spanky+the+monk · · Score: 2, Funny

      No, just ubiquity.

    18. Re:Finally by zoips · · Score: 2, Informative

      You should check out Pike. Lot nicer than PHP and still has all of those things you mentioned.

    19. Re:Finally by Poltras · · Score: 1

      Slashdot isn't PHP? Damn...

    20. Re:Finally by kohaku · · Score: 1

      [PHP is] remarkably close to what C++ should have been ...

      Wow. Really? Somehow I feel you've never done any development for high-performance applications before.
      Variable length arrays? Try STL's vector or map. C++'s arrays are backwards compatible with C's, but that's not to say it's not sensible behaviour- growable arrays have a fairly big overhead.
      Also, I'm not sure where your gripes with C++'s string manipulation come from, but I suspect you really haven't looked into the STL libraries very much. I often see C++ coders rewriting even basic things like vector or some of the algorithms (poorly) just because they didn't know about them
      Preach PHP all you want, but don't try to tell me that it's better designed than C++. It's simply not true.
      A side note, what's the point of OO in dynamically typed languages? It kinda defeats the point of inheritance & polymorphism...

    21. Re:Finally by ooloogi · · Score: 3, Interesting

      I didn't mind PHP until I tried porting a a PHP text processing application I'd written into C++. The conversion into C++ (with STL and Boost) was essentially line-for-line, so the lines of code was the same, but the C++ was more readable. The PHP runtime was 32ms, while the C++ was 1.9ms.

      Even in PHP territory, PHP wasn't giving any advantages, but several disadvantages.

    22. Re:Finally by ooloogi · · Score: 1

      The fact that you can use it with C++ means that C++ isn't at a disadvantage in terms of library. So then C++ has advantages, but not disadvantages: that was the point.

    23. Re:Finally by Anonymous Coward · · Score: 0

      Perl.

    24. 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.

    25. Re:Finally by shutdown+-p+now · · Score: 1

      One thing I hope PHP would have is GUI stuff for both Windows and Linux.

      For Windows, have a look at Phalanger. It's effectively an implementation of PHP on .NET platform (Microsoft sponsored, but open source under a non-GPL, custom copyleft license). It can work with web PHP apps just fine, but it also gives you access to the entire .NET framework class libraries, including WinForms. And it supports the visual form designer in Visual Studio.

      Oh yes, and it extended the language to support namespaces, and it uses ::: for namespace separator ;)

    26. Re:Finally by ooh456 · · Score: 1

      I think it comes down to... I know language x... so I will do everything I need to do in language x, even if there are better choices available. The mantra of software engineers used to be 'Right tool for the job'. I think it applies here.

    27. Re:Finally by nedwidek · · Score: 1

      Ditto here too. I use BlueHost to host and I _can_ use RoR, but I need to restart the app manually if the server is rebooted. CakePHP is really RoR like and since it is PHP it comes right back up with the server. So guess which I use.

      --
      Post anonymously - For when your opinion embarrasses even you!
    28. Re:Finally by goltzc · · Score: 1

      "Right tool for the right job"

      I couldn't agree with you more.

      To all programmers out there, learn multiple languages! Even if you just tinker with them. I guarantee you'll find yourself to be a better programmer and problem solver after you pickup some concepts of a new language.

      --
      Our bugs are smarter than your test scripts.
    29. Re:Finally by kohaku · · Score: 1
      C++ can't have been what you describe, because of one of the design goals: maintaining backwards-compatibility with C. As soon as you start making arrays behave differently, you break a lot of code. C++'s strength is that it has powerful high-level language features while allowing C's (relatively) low-level stuff.
      As for C++'s STL libraries being difficult to use, I have to disagree again. Let's take vector as an example. Elements are accessed the same way as regular arrays (square bracket notation), and the notation for using templates (i.e. vector<int> ints;) is really not difficult. Actually writing template functions is a little harder, though. I am frankly amazed you think the C preprocessor is equivalent in usefulness to templates, so in case i'm being stupid here, would you explain how you implement a generic container using the preprocessor? For that matter, what do you find nicer about the C preprocessor than templates? Littering source code with #defines and #ifdefs surely can't be neater...?

      As for OO in PHP, I don't see why you think dynamic typing decreases the value of object-oriented programming.

      It's not that I think dynamic typing decreases the value of OO, but that I think OO decreases the value of dynamic typing.

      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.

      Which is why I really don't see the value of forced dynamic typing- it makes code less clear, puts 'compile'-time errors at runtime, and generally reduces performance all around.

    30. Re:Finally by dgatwood · · Score: 2, Informative

      There's nothing preventing a native foreach notation built into the language instead of glued on. They just didn't do it that way, and they should have.

      would you explain how you implement a generic container using the preprocessor

      Sure. It's pretty easy. You just define two macros (e.g. BASE_TYPE and ARRAY_TYPE) and then #include a header.

      #define BASE_TYPE uint64_t *
      #define ARRAY_TYPE uint64_t_pointer
      #include <CustomArray.h>

      And in CustomArray.h>:

      #define MAX_SIZE 32

      class ARRAY_TYPE
      {
      BASE_TYPE[MAX_SIZE];

      }

      This is, of course, a trivial example. If you really want to get fancy, you can take advantage of token gluing.

      #include <NewCustomArray.h>

      And in that header:

      #define MAX_SIZE 32
      #define ARRAY_TYPE Array_##BASE_TYPE
      #define ARRAY_PTRTYPENAME Array_##BASE_TYPE##_ptr
      #define ARRAY_PTRTYPE Array_##BASE_TYPE *

      class ARRAY_TYPE
      {
      BASE_TYPE[MAX_SIZE];

      }
      class ARRAY_PTRTYPENAME
      {
      ARRAY_PTRTYPE[MAX_SIZE];

      }

      And simultaneously create two classes, one for pointers to the type, one for the bare type. About the only place where this wouldn't work is if BASE_TYPE is "void" (since that makes no sense as a nonpointer type), and you can fix that with a simple preprocessor test.

      --

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

    31. Re:Finally by kohaku · · Score: 1

      I have a couple of issues with that code. First, If I want to create multiple CustomArrays of differing base types, in C++ I can do
      CustomArray<int> ints;
      CustomArray<char> chars;

      With the C preprocessor, I can only do a single define, and I'm stuck with that single base type. Secondly, That's a _lot_ more code, and it's a _lot_ uglier...
      Lastly, about the foreach loop- I can see where you're coming from about it being 'glued on', but i've never really found it to be much of a hindrance. Apparently C++0x has something similar, though.

    32. Re:Finally by dgatwood · · Score: 2, Informative

      No, there's nothing preventing you from including that header file multiple times for different types. That's the beauty of token gluing. It concatenates the base type as part of the name of the derived array type, so you can create arbitrary numbers of them for arbitrary types. And unlike the template class, whenever you use the resulting type, it just looks like an ordinary C++ class instance with no need for template parameters. Thus, when you actually use the class, you just use "Array_int *foo" or whatever. Outside the syntax in the header file itself (which I'll admit isn't pretty), the usage syntax is cleaner this way.

      Regarding the amount of code, in terms of file length, the C preprocessor version will generally be shorter in the long run. You only have to build the classes once, included from one file. Everywhere else, you just use an opaque forward reference to the class, e.g. "class Array_int;". The header for defining the class also is shorter; although you have the extra couple of macros up front, you save at least as many bytes over the course of the file by not having to litter it with template parameters everywhere. Ditto for the other source files.

      And in terms of code generation, it's exactly the same amount of compiled code; the C++ compiler is generating separate classes under the hood for each of those base types. The only difference is that with preprocessor macros, you create the class explicitly up front with its own name so the instantiation syntax is cleaner.

      --

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

    33. Re:Finally by kohaku · · Score: 1

      No, there's nothing preventing you from including that header file multiple times for different types.

      Okay, I missed that. However, once you start doing things like including generic functions/classes in other generics, and doing compile-time calculations you're going to have headaches, namely because the C preprocessor only does a single pass on the code.
      Back to code length: the C preprocessor version forces you to define multiple constants and include a header for each specialization of the template. Given that C++ can also infer template arguments from function arguments, I would have thought the C++ would be shorter.

      The only difference is that with preprocessor macros, you create the class explicitly up front with its own name so the instantiation syntax is cleaner.

      My opinion is the complete opposite of this- explicitly having to specialize a template with a bunch of defines and an include each time seems fugly. Perhaps we'll just have to agree to disagree on that one :-)

    34. Re:Finally by Yvan256 · · Score: 1

      hint: click the link.

    35. Re:Finally by Anonymous Coward · · Score: 0

      take a look at http://eyeos.org/ and tell us what do you think

    36. Re:Finally by Nicolay77 · · Score: 1

      That's why I use wxWidgets when I use C++.

      --
      We are Turing O-Machines. The Oracle is out there.
  2. Not very early by ShawnCplus · · Score: 1

    There have been "sneak peeks" at PHP6 for a long time. This is by no means early.

    --
    Excuse me while I gather the virgin sacrifice and assemble the pentagram required to solve your problem
  3. So... by msh104 · · Score: 4, Informative

    without wanting to be overly sarcastic..

    What features are they gonne break this time?

    1. Re:So... by 77Punker · · Score: 4, Insightful

      Gotta break some eggs to make an omelet.

      Hopefully this will include cleaning up the argument lists of the string and array functions so that they hall take f($needle, $haystack) in a consistent order. Fixing the argument lists isn't in TFA, but it's a really obvious place to start.

      At work, it may give me an excuse to rewrite a horrible old app that's been holding us back since the days of PHP4. I suspect I am not alone in wanting to see some old (buggy, slow, insecure, poorly designed) PHP apps get ruined so that they can be redeveloped now that PHP5 is actually a decent language.

    2. Re:So... by tayhimself · · Score: 1

      The function naming convention needs to be fixed as well as the argument lists that you mention. The naming scheme is a little haphazard. Although if you use eclipse or another dev suite, autocompletion of the function names etc does save having to constantly look it up.

    3. Re:So... by maxume · · Score: 1

      Unicode support.

      --
      Nerd rage is the funniest rage.
    4. Re:So... by uncledrax · · Score: 1

      mod +1; I also hate the Needle/Haystack Haystack/Needle operator ordering..
      of course upgrading your code to make it compliant will be a PITA...

      --
      ----- The internet has given everyone the ability to have their voice heard equally as loud.. even if they shouldn't be
    5. Re:So... by Anonymous Coward · · Score: 0

      They will remove register globals and some other stupid shit which is good.

      they will keep short php tags though.

    6. 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..

    7. Re:So... by AbbyNormal · · Score: 1

      But if Python does it, its okay?

        If you don't like the new features, stick with the old one.

      --
      Sig it.
    8. Re:So... by Burkin · · Score: 1

      But if Python does it, its okay?

      No. From whose ass did you pull that strawman from?

    9. Re:So... by Anonymous Coward · · Score: 0

      I have slightly less than that many sites in the old version of our cms (in perl). Despite a mostly automated processes that lets me bring them up to the latest version, they're just sitting there.

      Why? Users. Thousands of them. You can just force a new version of software on people, you have to provide carrots and sometimes sticks.

      Or you could just upgrade them, but be sure not to complain when they get pissed and stop sending you checks.

    10. Re:So... by Frosty+Piss · · Score: 0, Flamebait

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

      That's hard to believe, both that there are any hosts still tunning PHP4, and that there are significant rumblings over upgrading to current technology.

      In a day and age where staying on top of the latest software upgrades to prevent hacking and such things is simply expected, who the hell are these people that can't live without php4?

      I trying to figure out what kind of troll the parent is.

      --
      If you want news from today, you have to come back tomorrow.
    11. Re:So... by msh104 · · Score: 3, Interesting

      I wouldn't mind, but my boss likes to get paid when i work for him...

      A general upgrade project we run looks like:

      1. We talk to the customer that the site that WE wrote for him now sucks because WE wrote it with function xyz that is now broken and sucks. ( we formulate this different, but this is about how it feels to the customer )

      2. customer complains that he paid for his site and that he expects it to just work.

      3. we explain that our knowledge of what will happen to future versions of the product is rather limited and that we therefore in principle can only make the best dessisions at a given time, that we regret the problems, but cannot help it. we then usually evaluate the components that are used in the website, CMS version, modules, tweaks, how much was done by outsourcing, etc and send it of to the customer.

      4. customers views the estimate and nearly dies from a heart attack when he sees what it will cost to port his website to a new php version without any increase in function.

      5. if we were lucky in fase 3 / 4 we have been able to get him addicted to some additional services as well that "only work with php5" making the upgrade path somewhat worth it. If that fails the customer in 90% of the cases won't think the upgrade path is worth it and will arange with us that we will keep hosting the site but without warrenty.

      This has not so much to do with being lazy, but more with being in a commercial company and having a customer that does not think it's worth to pay.

    12. Re:So... by Scotch42 · · Score: 1

      I'm with you on this... I still have production site running in php3 on old debian boxes. and the customer doesn't want to upgrade an old time zinning team... just 0.05 EUR...

    13. Re:So... by msh104 · · Score: 2, Informative

      I wish i was trolling, but trust me, i work for a company that hosts sites, and there is still plenty of php4 around. Most people don't mind the upgrading and staying up to date part so much. But they usually don't like the price that comes attached with it.

    14. Re:So... by Anonymous Coward · · Score: 0

      They will remove register globals and some other stupid shit which is good.

      And even more than that, register globals and that other stupid shit has been deprecated for a loooong time now, so people have no one to blame but themselves if removing that stuff breaks their code.

    15. Re:So... by Anonymous Coward · · Score: 1, Insightful

      Perhaps your customers freak when they read your spelling.

    16. Re:So... by tendrousbeastie · · Score: 1

      I'm in the UK, and I manage websites for various organisations, perhaps 10 different sites, and not one of them is running PHP5.

      I can't think that I've ever seen a web host running v5. (although I accept my experience is not universal, it is merely anecdotal).

      The only times I can reliably run OOP code in my PHP is when I run it on servers I own (basically my work servers.)

    17. Re:So... by Firehed · · Score: 1

      It won't happen to the base functions simply for backwards-compatibility, but given that namespace support is being added into PHP6 (I think it's also in 5.3; I have 5.2.6 on my machine so I don't know for sure) they could re-map all of those old functions in the global namespace into new logically-named and consistent functions. Array and string manipulation functions come to mind as the worst offenders, but there's plenty of other bad stuff as well. I think a lot of it would do well to be remade into built-in classes given that PHP5 has pretty solid OO support already (at least compared to 4). Nothing stopping anyone from doing that on their own right now; it just seems like a lot of unnecessary work when it would fit well in SPL.

      --
      How are sites slashdotted when nobody reads TFAs?
    18. Re:So... by SimHacker · · Score: 0, Flamebait

      It has everything to do with you being unprofessional for using PHP in the first place. You SHOULD have known PHP sucks, and you WOULD have known PHP sucks and there are much better alternatives, if you had done you research. -Don

      --
      Take a look and feel free: http://www.PieMenu.com
    19. Re:So... by pwfffff · · Score: 1

      Yeah I was a bit skeptical too, until I looked over at my second monitor which currently has the work I'm supposed to be doing on it.

      Yay, COBOL.

      The programs I'm maintaining are older than me. Literally.

    20. Re:So... by BikeHelmet · · Score: 1

      If you want something that maintains compatibility, go with java.

      Depending on your point of view, that could be a negative or a positive.

    21. Re:So... by Max_W · · Score: 1
      I agree. I had to re-write OOP PHP code because PHP5 was not available.

      Still recalling a horror of writing in Perl in 90s, I would say PHP is good, more or less.

    22. Re:So... by rackserverdeals · · Score: 1

      If you want something that maintains compatibility, go with java.

      Depending on your point of view, that could be a negative or a positive.

      This was the first PHP related story on Slashdot that didn't have a few dozen replies that mention Java until you went ahead and ruined it.

      I'd choose Java over PHP any day though.

      --
      Dual Opteron < $600
    23. Re:So... by Max_W · · Score: 0, Troll
      What alternatives? ASPX is slow, expensive and ugly. JAVA is cryptic. Maybe PERL? I had enough of PERL in 90s, thank you.

      PHP just works. And works fast.

      I think ASPX and JAVA are needed to IT-mafia to impress CEOs who heard somewhere of Microsoft and SUN.

    24. Re:So... by ukyoCE · · Score: 2, Informative

      You must be confused, are you thinking of Perl?

      PHP has been VERY careful about breaking features, and have essentially openly mocked the people who suggest they "fix" PHP's functions by randomly swapping argument order on functions that have been working just fine for years.

      The only thing I can think of they've broken is MAGIC_QUOTES and registered globals. Both are Very Bad Things that it was important they do away with. Any sane PHP code will react to their removal by simply removing a few chunks of good that were necessary to route around those features on servers that had them enabled.

    25. Re:So... by ukyoCE · · Score: 2, Interesting

      There are some new features in php 5 and php 6, but besides some worst offenders (magic quotes and registered globals) are entirely backwards compatible with PHP 4 code.

      I had the pleasure of upgrading a Large website from PHP 4 to PHP 5 and it was honestly quite trivial. 5 to 6 will be the same, except for removing the option of turning magic quotes and registered globals back on. But you fixed it the right way from 4 to 5 by not using them anymore anyway, riiiight? :)

    26. Re:So... by Anonymous Coward · · Score: 0

      Wow, you're a flaming moron. They really should be doing websites in Java right, and taking 6 times as long to code them, and 3-4 times as much hardware to run them? Or perhaps in ASP.NET and requiring tens of thousands more in software and hardware to develop and code them?

      PHP is the best language there is for the web right now. I'd love to hear what alternatives you think are so much better.

    27. Re:So... by Yoozer · · Score: 1

      Python with Django.

    28. Re:So... by zoips · · Score: 1

      Python, Ruby, x86 Assembly, LOLCODE, the list goes on...

    29. Re:So... by amicusNYCL · · Score: 2, Interesting

      I'm sort of curious as to the scope of changes that you actually do to migrate a site, what are you really needing to do that causes the customer to decline, I mean how much work is really necessary? What things are you finding that you need to do consistently to move a site from PHP4? When most people have asked me what might break when they flip the switch on the server to go to PHP5, I usually just talk about the changes in default settings, like register_globals being disabled (which never should have been used in the first place), or safe mode being disabled (which wouldn't have an affect really anyway).

      I'm curious to get your feedback on what kinds of changes actually need to be made though, I've been developing with PHP since before 5 was ready to go, but I really haven't run into very much incompatibility at all as I move things between versions. The biggest problem I have is needing to port something for PHP5 down to PHP4, where I have to find compatible definitions of functions that are now built-in (json_encode comes to mind). And most of the time that happens, I end up convincing them to upgrade to PHP5 once I point out how old both PHP4 and 5 are (PHP5 is almost 5 years old at this point, PHP4 is 9 years old this month).

      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
    30. Re:So... by amicusNYCL · · Score: 1

      Now Don, you don't have to be bitter because PHP programmers are taking away all the jobs you wanted to use your FORTRAN and COBOL skillz for.

      I'm not on your lawn either, so don't bother.

      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
    31. Re:So... by BikeHelmet · · Score: 2, Informative

      At least I ruined it by being informative. :P

      Java applets coded back in 1996 still run in the newest JRE. Pretty impressive for the consumer/user, though it must be a nightmare to maintain.

      I'm not aware of any huge changes to Apache Tomcat in the past few years - certainly nothing that required re-coding an entire website from scratch.

    32. Re:So... by petermgreen · · Score: 1

      I was under the impresion that the object model changed hugely from php4 to php5 so if your code was object orientated there was a large change it would be broken in a big way by php 5.

      Thats just what i've heard though, i've only done relatively minor stuff in php myself (though I did make a small contribution to mediawiki).

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    33. Re:So... by jamonterrell · · Score: 2, Funny

      You made a much wiser decision in going with perl. You have virtually no risk of an update coming out that breaks backwards compatibility.

      --
      I can count to 1023 on my hands. Ask me about #132.
    34. Re:So... by mattwarden · · Score: 1

      Doesn't make any sense. Either you're doing something terribly wrong, or these other hosting providers that are offering php4 are having the same concerns as you. Or, perhaps, these other hosting providers are specializing in offering legacy php4 hosting, in which case you would be better off letting those customers go to the specialized legacy host, because you will never be able to compete with them.

    35. Re:So... by ianare · · Score: 1

      You've obviously never received emails from customers.

    36. Re:So... by gullevek · · Score: 1

      Actually most of it works in php5. Some minor things didn't at the beginning.

      Unless you wrote super ugly code (highly possible in php), it was very easy to port to php5.

      --
      "Freiheit ist immer auch die Freiheit des Andersdenkenden" - Rosa Luxemburg, 1871 - 1919
    37. Re:So... by Anonymous Coward · · Score: 0

      Ruby? Now I know for sure you have no clue about what you're talking about.

    38. Re:So... by kae_verens · · Score: 1

      amen to that!

      it's so bad that /every/ time I encounter something which is either needle/haystack or haystack/needle, I need to go back to the documentation.

      and I've been writing PHP since the 90s...

    39. Re:So... by ooh456 · · Score: 1

      This is a good point. The problem is that programming is like gardening. You can't expect a garden you plant one year to be as beautiful the next year without a little work. You need to weed, prune, replant, and fertilize it.

      In programming we need to patch and refactor. It's all for the best really. The way to sell refactoring to a customer is to tell them that sooner or later, without it, they are heading for a meltdown. It's not because the program was bad when you wrote it, it's just that entropy is the way of the universe.

      No application, especially a web app, can withstand time without maintenance.

      Also no web programmer can survive on new projects alone. Eventually maintenance and upgrades come into the picture.

      If your clients don't understand that, then you need new clients more than your current clients need you. And you can quote me on that. I've been building web apps for 12 years. None on the sites I built 12 years would still be relevant or working today without upgrades.

    40. Re:So... by JAlexoi · · Score: 1

      Hm... You must be new to development? None will upgrade just for the fun of upgrading.
      To make people upgrade you need them to want new functionality. And increasing the price for new functionality as time progresses, you can then tell the client that the with the new version new functionality will cost less and you can even tell them how much they would "save" ;)

    41. Re:So... by Anonymous Coward · · Score: 0

      The only python websites I've ever seen (and I work at a datacenter) is Zope, which is a tremendous problem for everyone that grew beyond 2 users.

      Ruby is a joke.

      PHP is the best language for coding websites right now. It may not have some features for overarchitecting morons, but that's what Java is for - when you want to have a 20-man team do the work a 4-man team could do in PHP.

    42. Re:So... by NMEismyNME · · Score: 1

      With the argument ordering stuff, they could just do what they did with microtime() where they added the extra argument so you could call microtime(true) instead of that list($sec, $usec) = microtime() crap.

      Can't remember one of the backwards ones off the top of my head, but using in_array as an example,
      bool in_array ( mixed $needle, array $haystack [, bool $strict] )
      can become
      bool in_array ( mixed $needle, array $haystack [, bool $strict, bool $swapNeedleAndHaystack] )

      and a PHP warning can be raised if you don't pass the $swapNeedleAndHaystack argument warning that functionality for this method will switch in PHP 7 and will throw an error if it isn't passed, then in PHP 8 it can be removed entirely so it looks like this:
      bool in_array ( mixed $haystack, array $needle [, bool $strict] )

      Again, I'm not sure if in_array() is one of the backwards ones and I can't think of one off the top of my head, it's just an example.

    43. Re:So... by Tablizer · · Score: 1

      More power to your "stubborn" customers. Being forced to upgrade just because it's not the "newer version" can be annoying and time-consuming. It's almost like telling someone they can't drive a 10-year-old car JUST because "it's old".

      I hope hosting companies make it easy to select PHP versions so a simple switch or indicator file can be used to control such.

         

    44. Re:So... by Glendale2x · · Score: 1

      Don't forget register globals. Worst option ever.

      --
      this is my sig
    45. Re:So... by gullevek · · Score: 1

      well, that should be off anyway. any application still relaying on it should be permanently nuked ...

      --
      "Freiheit ist immer auch die Freiheit des Andersdenkenden" - Rosa Luxemburg, 1871 - 1919
  4. So, when will PHP 6 be released? by thue · · Score: 3, Interesting

    All very good. But there is no set release date; I wonder when PHP 6 will be released?

    They have been working on PHP 6 since at least 2005, and from monitoring announcement etc., I haven't seen any signs that they are nearing a release.

    1. Re:So, when will PHP 6 be released? by Burkin · · Score: 2, Funny

      I heard it'll be released the same day as Duke Nukem Forever as 3D Realms will be using it in the relaunch of their site for the game.

    2. Re:So, when will PHP 6 be released? by AndrewNeo · · Score: 2, Informative

      I don't care, as long as they fix all these inconsistencies and everything everyone else complains about, then they can take their time.

    3. Re:So, when will PHP 6 be released? by geber22 · · Score: 1

      Ha they have been working on Perl 6 since the death of Obi-Wan Kenobi, of course that was in a galaxy far far far away, but still a long time coming.

    4. Re:So, when will PHP 6 be released? by Anonymous Coward · · Score: 1, Informative

      Wow, that might be the last time I hear that joke. It's a sad day, indeed.

    5. Re:So, when will PHP 6 be released? by Puppet+Master · · Score: 1

      Around the same time as Duke Nuke'Em Forever :)

      --
      The day Microsoft creates a product that doesn't suck, it will be known as the Microsoft Vaccuum Cleaner!
    6. Re:So, when will PHP 6 be released? by Anonymous Coward · · Score: 0

      Isn't PHP 6 the Duke Nukem of Languages, when it comes to release dates?

      It's almost done! And it's gonna be released when it's done...

    7. Re:So, when will PHP 6 be released? by sherriw · · Score: 1

      My host just made PHP5 the default starting this year. So 5 is still new to me.

  5. Time to pay the piper... by Onyma · · Score: 4, Insightful

    I am definitely no PHP expert so perhaps I am wrong but it seems that much of what is being changed is backtracking due to bad language decisions from the beginning. Sadly I think PHP developers with legacy code are going to be paying the price for several versions to come.

    --
    Play me online? Well you know that I'll beat you. If I ever meet you I'll "/sbin/shutdown -h now" you. -Weird Al, kinda.
    1. Re:Time to pay the piper... by FictionPimp · · Score: 5, Funny

      This is why I never write legacy code, only progressive forward thinking code!

      People who write legacy code are just not thinking of the future.

    2. Re:Time to pay the piper... by Anonymous Coward · · Score: 4, Insightful

      You're not far off track. A lot of PHP's problems stems from the fact that the language itself was more or less kind of thrown together rather than planned out (from the early simple Personal Home Page scripting stuff to PHP3 that just kept extending things and adding more functionality bolted on). They only just began to start to stabalize some of that in PHP4 and really only started to fix a lot of issues in PHP5 and now PHP6. They are making good strides but there's a lot of work to do (and a lot of backwards compatible considerations, I'm sure).

      The good news for PHP developers with legacy code is that they've had a long time to fix things. Stuff that is going away has been deprecated for many versions now so none of this should be a surprise. The people that will get hit are the site administrators using PHP based apps that haven't been updated in forever.

    3. Re:Time to pay the piper... by SanityInAnarchy · · Score: 0, Flamebait

      PHP itself is one giant bad language decision.

      --
      Don't thank God, thank a doctor!
    4. Re:Time to pay the piper... by 77Punker · · Score: 4, Funny

      I think PHP developers with legacy code are going to be paying the price for several versions to come.

      I prefer to call it "job security".

    5. Re:Time to pay the piper... by zwei2stein · · Score: 1

      You will love it when they add functional approach and constructs. Declarative style in php for more points!

      --
      -- Technology for the sake of technology is as pathetic as eschewing technology because it's technology.
    6. Re:Time to pay the piper... by phatslaab · · Score: 1

      Those complaining about migration from PHP4 do have a small gripe but the fact is that the developers gave people ample time to plan for the end of PHP4 support. PHP5 has been out since 2004 - it's 5 years later!!! Since PHP is a young language that was built for a totally different purpose than what it is used for today, things like breaking backwards compatibility are necessary for its maturation. Just look at a description of Rasmus' original implementation of PHP (Personal Home Page) and you'll see this language needed to be altered for the heavy lifting it tries to do today. The culture had to and must continue to change. Unlike Java or other robust languages, PHP was created from the ground up to be Christina Aguilera...er, I meant quick and dirty.

      PHP4 which was the first version of PHP that was really ready for widespread use was released in 2000 with much of the cruft that made PHP/FI 2 swiss cheese when it comes to security. Also, it had hacked-on OO syntax and even though you could create your own objects, it was more about OO syntax than function. PHP5 changed a lot of key things, especially those having to do with objects, mysql, new extensions, and quite a few variables.

      The changes between PHP4 & PHP5 weren't that big of a deal as some made them out to be though. Its not like it went from -> to .dot syntax. Things are much less painful this time around going from PHP5 to PHP6. They are mainly doing some housekeeping, unifying some parts of the most used pieces, making it play nicely with the world's many languages, and shaving off the stuff that causes the most security problems. No biggie. The security benefits, speed, built-in caching (APC), & bug fixes give people added incentive to upgrade.

      -PHP Expert

    7. Re:Time to pay the piper... by ukyoCE · · Score: 1

      That's one way to put it, and not entirely wrong.

      The list of features being deprecated is very small. And these are "features" that people have been universally panned and avoided for years. Back in PHP 5 these "features" were disabled by default.

      PHP 6 is just finally (years later) hitting the Off switch for good.

      The apps affected by this will be:

      1) Apps developed 4+ years ago

      2) Apps developed 4 years ago by teams with zero experience in PHP who did zero research, or intentionally ignored best practices being used and recommended everywhere.

      Most apps that need to be changed for these features are vulnerable to variable overwriting and sql injection, and always have been. Best case, these apps tend to MAGICALLY add 2-4 backslashes to any form input you put a quote into. Adding more every time you resubmit the form. You should've seen the number of backslashes in some people's names at a previous job where I got to fix these poor practices...

    8. Re:Time to pay the piper... by amicusNYCL · · Score: 1

      it seems that much of what is being changed is backtracking due to bad language decisions from the beginning.

      As much as I love PHP, that's exactly right. Something like the register_globals option should have never even seen the light of day, much less even been placed on the drawing board.

      Thankfully, a good programmer is a good programmer regardless of the language, so I think that most of the people who will need to scramble through their code fixing things are probably the same guys who learned programming from a free tutorial in the first place. The switch from PHP4 to PHP5 didn't affect my existing applications at all, and looking over the list of changes for PHP6, I'm not expecting a lot of heartache this time through either. The difference between me and a lot of other PHP programmers is my computer science degree. The huge amount of free online PHP tutorials directly explains the huge amount of poorly-written PHP code (much of it in the same tutorials).

      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
    9. Re:Time to pay the piper... by Anonymous Coward · · Score: 0

      > PHP was created from the ground up to be Christina Aguilera...er, I meant quick and dirty.

      But not easy, eh? :D

    10. Re:Time to pay the piper... by Anonymous Coward · · Score: 0

      The difference between me and a lot of other PHP programmers is my computer science degree.

      How does a computer science degree help? Most of you suck. Oh sure, you're great at sitting around spewing theory and stroking your big-O, but you can't actually *do* anything with it.

      Now, if you had an honest-to-goodness software engineering degree you might be able to open your mouth without deep-throating the huge dong of doom.

    11. Re:Time to pay the piper... by sherriw · · Score: 1

      Sure, we could complain about those poor decisions in the first place, but I admire any person or organization willing to admit past mistakes and take steps to correct it.

    12. Re:Time to pay the piper... by Anonymous Coward · · Score: 0

      Well sor-ry, let me clarify. I have a "Bachelor's of Science and Engineering" in "Computer Science and Engineering" from a major university. Software engineering courses were part of the core curriculum, and software engineering, design, and development is my profession, since before I graduated 6 years ago. The current (PHP) application I'm working on has 2200 hours of design and development time behind it, all by me, and has around 70,000 users. In fact, I'm a lot better at actually *doing* anything than I am at spewing theory and stroking my big-O.

      Like I said, even though most classes were taught around C++, and I've never taken a PHP class in my life, a good programmer is a good programmer regardless of the language.

    13. Re:Time to pay the piper... by amicusNYCL · · Score: 1

      I also apparently have problems with the "Post Anonymously" box.

      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
    14. Re:Time to pay the piper... by inKubus · · Score: 1

      Well, hey, this popup form works in IE8! Sorry. Where was I? Ah, yes. Looking at it pretty closely you can see that they are pretty smart over at Zend. PHP has almost as many trained followers worldwide as the most viable competitor, ASP and the .NET framework. C# is pretty decent but .NET framework is quite good for what it is (free as in money, not dumb). And the Visual Studio integration is the best IDE.

      Now before you get your panties in a bunch, I'm trying to be realistic here about the options for a modern developer making web-based applications. I program mostly in PHP now, on a Mac, hosted on CentOS servers running a kernel that I compiled. I am not a windows fan, but there is simply not a competitor.

      Now, looking at Zend, you're starting to see a possible competitor:

      Windows has .NET, We have Zend Framework
      They have IE/Sharepoint Services, We have Zend Platform or whatever they call it now
      They have Visual Studio, we have Eclipse.

      I forsee PHP6 as a step back from trying to include so much crap in the standard libraries. I mean, you're only doing a major version release every 5 years so your standard libraries are not going to be updated enough to stay with current tech. So the focus will be on syntax and less on library functions. That's what frameworks are for! I mean, why mess with strstr and 20-30 lines of if else when you can use Zend_Filter, chain objects together, this is the modern age!

      If they can get it running a little faster, clean up the syntax and the consistency (as others have mentioned) and try to build some cohesion between all the competing frameworks out there and I think it could be a .NET crusher. Because you don't have to have Windows servers to run it. Which means 50% less cost per server (in software). Traditionally that's been made up with Sysadmin Hours but I don't think that'll be happening too much longer.. Anyway, my erratic 2 cents.

      --
      Cool! Amazing Toys.
  6. Object Oriented support in PHP by Anonymous Coward · · Score: 0

    How good is the object oriented support in PHP these days?

    I haven't used PHP in a couple of years. I gave up because it didn't support object inheritance very well (maybe even at all).

    Feedback from anyone who is current with PHP would be much appreciated.

    1. Re:Object Oriented support in PHP by revlayle · · Score: 2, Informative

      PHP5 and, soon 6, is pretty strong. PHP5 has a fairly proper inheritance and member visibility model and is truly reference based (i.e. $objX = $objY means, in PHP5, that they are reference to the same object instance... opposed to PHP4 where $objX = $objY made a FULL copy of the object to $objX). Not perfect, but not bad - the rest of the language/API needs a cleanup, which lookd like v6 will help address.

    2. Re:Object Oriented support in PHP by Dragonslicer · · Score: 2, Informative

      How good is the object oriented support in PHP these days?

      Everyone involved with PHP pretty openly admits that PHP5's OO model is a direct ripoff of Java, so inheritance, abstracts, interfaces, and access modifiers work pretty much the same way as they do in Java. If you like Java's OO, you should be fine with PHP5's.

    3. Re:Object Oriented support in PHP by shutdown+-p+now · · Score: 2, Insightful

      PHP5 has a fairly proper inheritance and member visibility model and is truly reference based (i.e. $objX = $objY means, in PHP5, that they are reference to the same object instance... opposed to PHP4 where $objX = $objY made a FULL copy of the object to $objX).

      So they've got to the level of Java 1.0. Congratulations!

      Oh, actually, sorry, they didn't, since there are still no namespaces. But there will be soon, and then it'll be at the level of Java 1.0. Once again, congratulations!

    4. Re:Object Oriented support in PHP by revlayle · · Score: 1

      If you mean "soon" as in PHP6 will have namespaces, then yes, will be "soon".

    5. Re:Object Oriented support in PHP by shutdown+-p+now · · Score: 1

      Namespaces are coming in PHP 5.3, last I heard.

  7. question: by larry+bagina · · Score: 5, Insightful

    are these ass clowns still planning on using \ for namespaces?

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

    1. Re:question: by Anonymous Coward · · Score: 4, Informative

      Yes :(

    2. Re:question: by Anonymous Coward · · Score: 1, Insightful

      Can't break some eggs without raping an omelette.

    3. Re:question: by pizza_milkshake · · Score: 4, Funny

      The worst design decision yet, which is saying something.

    4. Re:question: by Just+Some+Guy · · Score: 4, Funny

      Can you blame them for trying to escape?

      --
      Dewey, what part of this looks like authorities should be involved?
    5. Re:question: by Anonymous Coward · · Score: 0

      Oh for fuck's sake, they're actually thinking of doing it. I was hoping I had gotten so stoned that I had given the year a miss and looped around to April Fool's Day.

    6. Re:question: by SnapperHead · · Score: 4, Interesting

      They are really going to destroy the language with this idea. Its a *VERY* bad design decision, and they really don't care what the community thinks of it. People suggested using ::: ... that claim its too many characters to type. Ok, how about : or . or one of the other suggestions.

      The decision was made in IRC without any community input. People are very unhappy with it, and they don't care. It almost makes me embarrassed to be a PHP developer.

      Maybe with some luck, a competent development team will fork it.

      --
      until (succeed) try { again(); }
    7. Re:question: by jamonterrell · · Score: 1

      Fork php to change the namespace separator :)

      --
      I can count to 1023 on my hands. Ask me about #132.
    8. Re:question: by Dragonslicer · · Score: 2, Interesting

      I think it's an incredibly stupid decision too (when we saw the decision at my last job, we decided never to use namespaces just because the separator would look ridiculous), but it still doesn't top register_globals and magic_quotes.

    9. Re:question: by Anonymous Coward · · Score: 1, Insightful
      Worst design decision? Wow, that'd be quite a compliment for PHP -- as Dragonslicer notes, there's, for example, magic_quotes.

      It's just a token, people, get over it. There was nowhere nearly as much brouhaha for Python's // operator (that looks like a C++ comment), or the ambiguity of the dot in Java, or VB's \ operator, or the fact that -- in Haskell starts a comment but --# is an operator, and the list goes on.

    10. Re:question: by shutdown+-p+now · · Score: 1, Informative

      The problem with \ is that it has a well-established meaning outside of string literals in most languages of the curly braces family, to which PHP also belongs at least on the surface. And that meaning (escaping Unicode characters - at least in C++, Java, and C# are those I know, and there are probably more) has absolutely nothing to do with namespaces.

      All your other examples are quite different - for example, there's no problem with Python using // for an operator, since it's decidedly not C'ish in appearance. VB has \ for integral division dating back to very early days of BASIC (before C, I believe). And so on.

    11. Re:question: by inKubus · · Score: 1

      $and->this->_is()->good->design();?

      --
      Cool! Amazing Toys.
  8. A likely story by Anonymous Coward · · Score: 5, Insightful
    As far as I can tell, PHP 6 is probably a long way off. End of 2009 at the very earliest. Consider this: PHP 5.3 introduced RC1 in March with the idea of 1-2 week intervals, and, here in May, we're still not at RC2.

    Given that PHP 6 was "rumored" to be out at least a year ago. I can't decide if the title "An Early Look" is meant to be ironic, or is just a sad indicator of progress.

    Despite that, I would say that three things have recently happened demonstrating the improvement in quality of PHP:
    1. End of Life of PHP 4
    2. Many important improvments in PHP 5.3
    3. Unicode in PHP 6

    I would say that (1) and (2) easily are more important for the language than is (3). PHP 5.3's improvements should be a huge change: Namespaces (I know there's a huge amount of hate for this implementation: get over it. It's going to be very useful), Closures / Lambda Functions, and Late Static Bindings in particular make it hard to wait so long for PHP 5.3.

    So, stop talking about PHP 6! Lets get PHP 5.3 out.

    1. Re:A likely story by Anonymous Coward · · Score: 0

      Yeah, let's forget about Unicode, because nobody in the world needs to represent glyphs other than A-Z... Oh, wait, yes almost everybody outside the US needs to do that.
      There is no technical reason why Unicode isn't the default in ALL software today, but there are a lot of people in NA, who still haven't realized that there is a world outside their borders, so it is not likely to happen anytime soon.
      Disclaimer: I live in the US, so I know some of these people first hand.

    2. Re:A likely story by Anonymous Coward · · Score: 0

      The technical reason would be: not caring about foreigners...

      Disclamer: I live in the US, and I am one of these people.

    3. Re:A likely story by vita10gy · · Score: 1

      I couldn't agree more. I want those late static bindings now, dagnabbit.

    4. Re:A likely story by amicusNYCL · · Score: 2, Insightful

      It's no defense, but the guy who started PHP, Rasmus Lerdorf, is apparently a Danish Greenlander, and the two guys who rebuilt the parser for PHP3 and on, and founded Zend, Andy Gutmans and Zeev Suraski, are both Israeli. As I said, it's no defense, but Americans didn't have anything to do with creating PHP.

      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
  9. Interoperability ? by heatseeker_around · · Score: 1, Interesting

    Nothing about migrations between 5&6 ? and 4&6 ? does it accept old crap code running under the V6 ?

  10. Hope it handles Search/Replace better by Jason+Levine · · Score: 1

    I hope it handles search/replace better. I tried doing a search/replace on a 88MB large string and the stupid script crashed! ;-)

    Seriously, though, if anyone knows of any good tactics for large-string searching/replacing, I'd be happy to hear them. My current attempt is multiple page loads in an iFrame while the user is presented with a "working on it..." message.

    --
    My sci-fi novel, Ghost Thief, is now available from Amazon.com.
    1. 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
    2. Re:Hope it handles Search/Replace better by SethJohnson · · Score: 1

      Have PHP run a command-line SED or AWK script. Without more details of how your 88mb file is structured, I can't predict how effective this suggestion is.

      Seth

    3. Re:Hope it handles Search/Replace better by Bigby · · Score: 1

      Assuming this 88MB string is in a file, you should never load the whole file. Open the file and read it chunk by chunk. As you read it chunk by chunk, do a search/replace on each chunk and write the replaced chunk to another file. You need to remember to catch the matches that span more than once chunk though.

      The question should really be why you are dealing with an 88MB file in PHP...

    4. Re:Hope it handles Search/Replace better by Just+Some+Guy · · Score: 3, Insightful

      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.

      And here the rest of us are grepping and sedding multi-gigabyte files without thinking twice. Seriously, what's your idea of a large file?

      --
      Dewey, what part of this looks like authorities should be involved?
    5. Re:Hope it handles Search/Replace better by nahdude812 · · Score: 2, Informative

      If you want to process large files (or any large chunks of data such as blob columns) in PHP without loading the entire file into memory, look into streams.

    6. Re:Hope it handles Search/Replace better by Firehed · · Score: 1

      Well, I once had to use PHP to re-import a MSSQL DB that was something like 25GB because no SQL machine was able to import even one of the 133 (?) files that made up the DB contents. Had to leave it running for something like 17 hours, but I think it ended up getting the job done well enough for what needed to be done.

      But yeah, I tend to avoid dealing with any large files in PHP whenever possible.

      --
      How are sites slashdotted when nobody reads TFAs?
    7. Re:Hope it handles Search/Replace better by i.r.id10t · · Score: 1

      Pass it off to sed ....

      --
      Don't blame me, I voted for Kodos
    8. Re:Hope it handles Search/Replace better by twostix · · Score: 1

      How on earth do you get an 88MB string?

      Please don't tell me it's from reading an 88MB file into memory at once.

      If that *is* what you're going to say, then fopen and a while loop are your friends.

    9. Re:Hope it handles Search/Replace better by Jason+Levine · · Score: 1

      The 88MB file is the combination of a series of XML files. I'm analyzing the information on a series of users. Each user's data is in XML format. To analyze it, I need to remove some unneeded parts of the XML file. (I've found that text search/replacing was faster than using an XML parser.)

      --
      My sci-fi novel, Ghost Thief, is now available from Amazon.com.
  11. Limited cleanup by Just+Some+Guy · · Score: 4, Insightful

    clean-up of several functions

    Does that include safe_quote_string_this_time_i_really_freaking_mean_it, or do_foo(needle, haystack) and foo_do(haystack, needle)? At least it gets namespaces after all this time, even if they're almost deliberately ugly.

    --
    Dewey, what part of this looks like authorities should be involved?
    1. Re:Limited cleanup by LWATCDR · · Score: 2, Insightful

      All I want is for $foo[0] and $foo["0"] to not be the same reference.

      --
      See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
    2. Re:Limited cleanup by Just+Some+Guy · · Score: 4, Funny

      But that might break something that two people found convenient in 1997 and therefore can never be repudiated.

      --
      Dewey, what part of this looks like authorities should be involved?
    3. Re:Limited cleanup by Anonymous Coward · · Score: 0

      Because in PHP every variable is either a class object reference or a variant (basically just a string).

    4. Re:Limited cleanup by neoform · · Score: 1

      They should have used # instead of the backslash for namespaces, that way, what I type will coincide with what I wish I was doing to the asshat that came up with that namespace delimiter.

      --
      MABASPLOOM!
    5. Re:Limited cleanup by clone53421 · · Score: 1

      Octothorpe?

      --
      Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
    6. Re:Limited cleanup by nahdude812 · · Score: 1

      In no language has quote escaping been the correct approach to putting untrusted data into a SQL statement for quite a long time (even if a language provides only this approach, it's still not the right approach). That stuff is kept for legacy support.

      Switch to PDO and start using bound parameters. No matter what happens with the database and heretofore unconsidered character sets, this will never suddenly become vulnerable to a SQL injection when you upgrade your database server.

    7. Re:Limited cleanup by CMonk · · Score: 1

      Ah, I love PHP. Oh wait, that's not love... that's hate, disdain and frustration.

    8. Re:Limited cleanup by abigsmurf · · Score: 1

      You forgot dofoo(needle, haystack) and foodo(haystack, needle).

      PHP has an excellent central resource site. I just wish they had sorted some consistent naming so I didn't have to visit it so often for syntax...

  12. My items to be fixed by Parker+Lewis · · Score: 3, Insightful

    My items to fix: - Remove the "goto" statement that will be introduced in 5.3 (WHY JESUS, WHY??); - Stardandize function names (current samples: str_replace, html_ entity_ decode, htmlentities, htmlspecialchars_decode); - Improve array speed (for simple arrays, use internally one simple C array/list - current days, any array is a map); - Insert optional configurations by project (and not by host); - Remove function alias; - Provide optional typing for functions and parameters, but in a simple and consistent way (no strange notations); - Remove old extensions, like PDF paid extensions (and please, insert any open and official PDF extension); - As any language, provide a way of store compiled regex, avoiding compile them all the simple regex call for the same task; - Provide legacy support for PHP5 application as separated download (or at least allow PHP6 and 5 in the same host - we suffer a lot to find PHP5 Hosting in the earlier times, due the impossibility of run PHP4 and 5 at the same host).

    1. Re:My items to be fixed by Parker+Lewis · · Score: 1

      I forgot: a real Locale subsystem, not one relying in the O.S. like the current (that not works on Windows).

    2. Re:My items to be fixed by clone53421 · · Score: 2, Funny

      You also forgot: <p>

      --
      Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
    3. Re:My items to be fixed by Anonymous Coward · · Score: 1, Insightful
      1. Remove the "goto" statement that will be introduced in 5.3 (WHY JESUS, WHY??);

        -1 It's a useful language construct with less overhead than exceptions. I'm going to overuse and misuse it out of spite for all those Dijkstra parrots who mindlessly repeat the mantra :-o

      2. Stardandize function names (current samples: str_replace, html_ entity_ decode, htmlentities, htmlspecialchars_decode);

        +1

      3. Improve array speed (for simple arrays, use internally one simple C array/list - current days, any array is a map);

        -1 Write an extension for carrays.

      4. Insert optional configurations by project (and not by host);

        -1 You can already do this via .htaccess sans security resourse limits which should be per host on shared hosting.

      5. Remove function alias;

        -1 Some of this is already done via namespaces, the problem was extensions like ming that defined rather generic aliases in the global namespace.

      6. Provide optional typing for functions and parameters, but in a simple and consistent way (no strange notations);

        -1 PHP already has type hints.

      7. Remove old extensions, like PDF paid extensions (and please, insert any open and official PDF extension);

        +1 Work to split off all but required bundled extensions into pecl begun some time back.

      8. As any language, provide a way of store compiled regex, avoiding compile them all the simple regex call for the same task;

        ? I think APC will cache the compiled regex from PCRE?

      9. Provide legacy support for PHP5 application as separated download (or at least allow PHP6 and 5 in the same host - we suffer a lot to find PHP5 Hosting in the earlier times, due the impossibility of run PHP4 and 5 at the same host).

        ? You can already do this with cgi, fcgi and there's workarounds (ie: proxy) for mod_php.

    4. Re:My items to be fixed by Parker+Lewis · · Score: 1

      Yeap, bad habit to post on sites that convert new line to HTML break line.

    5. Re:My items to be fixed by clone53421 · · Score: 1

      Change your default post settings to "Plain old text" and it will.

      --
      Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
    6. Re:My items to be fixed by mgkimsal2 · · Score: 2, Insightful


      # Insert optional configurations by project (and not by host);

      -1 You can already do this via .htaccess sans security resourse limits which should be per host on shared hosting.

      .htaccess only works under Apache, and then only in the context of a web request. If I'm working PHP shell scripts, .htaccess is useless to me.

    7. Re:My items to be fixed by Parker+Lewis · · Score: 1

      Thanks! :)

    8. Re:My items to be fixed by Anonymous Coward · · Score: 0

      WHY JESUS, WHY??

      Hey, they've got a reputation to uphold.

      They're actually trying to stem the transformation we've seen of PHP coders from "i-taught-myself-to-code-from-forums" and "monkey-with-keyboard" style to the "everything-I-write-should-involve-a-complete-class-hierarchy-and-the-ten-last-patterns-I've-read-about" style more commonly associated with Java programmers. They're planning to do this by inserting "temptations" in the language, for example the 'goto' statement, that they hope will bring back some of the wildly unstructured monolithic spaghetti code that has become PHP's trademark.

      If 'goto' proves ineffective, they'll introduce 'come-from' in 5.4, and as a last measure in 5.5, the infamous 'altergoto', together with a new experimental feature for more structured programmers, 'altr_catch'.

    9. Re:My items to be fixed by clone53421 · · Score: 1

      No problem.

      Incidentally, HTML still works in "Plain old text" posting mode... so you have to use the HTML entities &lt;, &gt;, &amp;, etc.

      --
      Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
    10. Re:My items to be fixed by nahdude812 · · Score: 2, Informative

      PHP compiles regex's transparently automatically. If you've used a pattern recently, it will not reparse the statement.

    11. Re:My items to be fixed by bluej100 · · Score: 2, Informative

      Improve array speed (for simple arrays, use internally one simple C array/list - current days, any array is a map);

      Try the SplFixedArray class. The SPL data structures are much, much faster. I actually rather like the "easy by default, fast when you need it" dichotomy.

    12. Re:My items to be fixed by Firehed · · Score: 1

      Look into ini_set(). There are a couple odd things you can't override through that, but 95% of the standard configuration can be changed that way. The only thing that doesn't that immediately comes to mind is one of the magic_quotes settings, presumably because the superglobals have already been established by the time you've hit the override function - and magic quotes is finally going away in php6 so that'll be a non-issue moving forward.

      --
      How are sites slashdotted when nobody reads TFAs?
    13. Re:My items to be fixed by AndrewNeo · · Score: 1

      fast-cgi, I believe, supports per-directory php.ini's.

    14. Re:My items to be fixed by The+End+Of+Days · · Score: 1

      If your app is so performance critical that the overhead of exceptions is worth optimizing out, why the hell are you writing it in PHP?

    15. Re:My items to be fixed by CarlosM7 · · Score: 1

      I wish we were given the option to require variable declaration...

    16. Re:My items to be fixed by rycamor · · Score: 1

      For shell scripts, all you need is php -c /path/to/alternative/php.ini

      You can have as many alternate configurations as you want.

      Honestly, if something seems like an obvious thing to want, chances are you just haven't looked hard enough to find it.

    17. Re:My items to be fixed by Anonymous Coward · · Score: 0

      Because I'm a wannabe programmer who thinks that just because I learned some PHP inbetween double shifts at my job cleaning up jizz in the masturbation booths at Jacks Whack Shack I'm some kind of oppressed genius who knows everything.

      And Kanye West is my BFF.

    18. Re:My items to be fixed by Parker+Lewis · · Score: 1

      Carlos, if you put the error reporting to E_ALL, the compiler will complain about variables being used without declaration.

    19. Re:My items to be fixed by The+End+Of+Days · · Score: 1

      oh, cool. That seems reasonable to me. Say hi to Kanye for me.

    20. Re:My items to be fixed by Parker+Lewis · · Score: 1

      I can't understand why introduce 'goto' just now.

      PHP has type hint only for object, and only in function parameters. Not for primitive types (5.3 has something), neither for function returns.

      About function alias: there are a lot of function alias in string functions. Why not remove them? Nothing related to namespaces here.

      About the item 8, I'm not talking about php code cache. Look to regex at other languages.

      About item 9: is not possible run two versions of PHP in Apache.

  13. Namespaces by Phroggy · · Score: 4, Interesting

    So let's say you've got a global variable, $n

    And let's say you're using it in a module, Foo

    And because scattering global variables everywhere is a stupid idea that will lead to much pain, let's say you've decided to use namespaces in PHP6.

    Now, in your main script, let's say you happen to be using a variable $Foo, for no particular reason.

    What does this do?

    <?php
    echo "Hello $Foo\n";
    ?>

    --
    $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
    $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
    1. Re:Namespaces by ari_j · · Score: 2, Funny

      It'll probably just print 90 copies of an error message that makes sense on the surface but gives no indication of what it actually means.

    2. Re:Namespaces by 77Punker · · Score: 1

      Use {$Foo} instead. It's the proper way to put variables in a string.

    3. Re:Namespaces by Anonymous Coward · · Score: 0

      I imagine the output of that would be the same as "echo 'Hello ' . $Foo\n;" since, for objects, PHP takes a greedy approach and grabs everything it can. For example,

      <?php
      class a {
      public $b = 'hello, world!';
      public function __toString() {
      return 'goodbye cruel world';
      }
      }

      $a = new a();

      echo "$a->b";
      echo "\r\n<br />\r\n";
      echo "{$a->b}";
      echo "\r\n<br />\r\n";
      echo "{$a}->b";
      ?>

      The first and third echo print out the same thing. The last echo prints out something something different.

    4. Re:Namespaces by edsousa · · Score: 3, Insightful

      Say that $Foo=3
      It will print
      Hello 3


      Because the namespace begins with a backslash ('\foo\n') and when using it inside double quoted strings must be "\\foo\\n".

    5. Re:Namespaces by bigtrike · · Score: 0, Troll

      If it's like anything else half implemented in PHP (such as exceptions), it will most likely result in: Unknown Error At Line 0 of Unknown

      And filing a ticket to ask that said error be made more descriptive will be angrily closed with a resolution of "that's just the way it is"

    6. Re:Namespaces by VGPowerlord · · Score: 1

      Hey, I can't imagine that would be asked a lot or anything. There's no way that would be in the PHP FAQ!

      Oh wait...

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    7. Re:Namespaces by Phroggy · · Score: 1

      Say that $Foo=3
      It will print
      Hello 3

      Because the namespace begins with a backslash ('\foo\n') and when using it inside double quoted strings must be "\\foo\\n".

      The example in the article didn't mention leading with a backslash, or at least I don't think it did (it's been slashdotted, apparently).

      And seriously? You have to escape the backslashes? What if you want a literal backslash now?

      --
      $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
      $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
    8. Re:Namespaces by Firehed · · Score: 1

      It'll print $Foo followed by a newline.

      Foo\$n would print $n in the Foo namespace. I think. Strictly speaking, you should wrap it in curly braces if you're using anything other than a "non-complex" (for lack of a better term) variable, including array contents and object members.

      If variable $Foo was a string that contained the name of some namespace ("bar", for example), then if it wasn't in a quoted string context it would look for constant bar\n, but constants aren't echoed when quoted.

      That said, I still think the original choice of :: instead of \ as a namespace separator made a lot more sense. I looked at the discussion and the switch did make a hint of sense, but a forward slash (or ANYTHING that wasn't the escape character) would have been a much better choice. Maybe ~? I don't think that's used anywhere else.

      --
      How are sites slashdotted when nobody reads TFAs?
    9. Re:Namespaces by amicusNYCL · · Score: 2, Funny

      Are you telling me that you're confused by this:

      <?php
      echo "Hello $Foo\n";
      ?>

      and then you put this in your sig:

      perl -e 'printf"%02X"x4,unpack"C4",gethostbyname"$_.aacs.phroggy.com" for qw/Just another Perl hacker/'

      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
    10. Re:Namespaces by iluvcapra · · Score: 1

      Whenever I get those, I just put an @ sign in from of "echo," then everything will work great! \dumbPHPkoder

      --
      Don't blame me, I voted for Baltar.
    11. Re:Namespaces by daveime · · Score: 1

      What, you mean like Perl does ?

      But I thought you all regarded Perl as an antiquated 90s dinosaur ?

      Alanis called, she wants her song back.

    12. Re:Namespaces by Phroggy · · Score: 1

      Glad you like my sig. Here's another:

      #!/usr/bin/perl
      for $a(1,46){for $b(0..7){$c=0;$_?hex substr(q), "ef7fa1866706ca",
      Just another Perl Hacker, ("eff02289402844"),2*$_+$a,2)&2**(7-$b):
      $_["phroggy"] and $c+=2**(7-$_)for(0..7);$d.=chr $c;}}print"$d\n";

      --
      $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
      $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
    13. Re:Namespaces by Anonymous Coward · · Score: 0

      I'm not sure, but you should be doing
      echo "Hello {$Foo}\n";

    14. Re:Namespaces by amicusNYCL · · Score: 3, Funny

      Gesundheit.

      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
    15. Re:Namespaces by LS · · Score: 1

      Complex variables are not interpolated in double quotes unless you use curly braces, so the \n will probably be interpreted as a line feed if they remain consistent.

      So if you wanted to use a name space in an interpolated variable, you would use the following notation:

      echo "Hello ${Foo\n}";

      BTW i think the backslash is a stupid design decision as well...

      LS

      --
      There is a fine line between being a cultivated citizen and being someone else's crop. - A. J. Patrick Liszkie
    16. Re:Namespaces by Jesus_666 · · Score: 1

      And seriously? You have to escape the backslashes? What if you want a literal backslash now?

      Then you write "\\" or '\'. The GP over-escaped. Backslashes work exactly like you'd expect them to, except in single-quoted strings as single-quoted strings get no preprocessing. You can construct scenarions where you need "\\\\\\\\" to express a single backslash but that's usually avoidable. Think "I dynamically call a shell script that calls another script and I forgot to take my pills today".

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
    17. Re:Namespaces by clone53421 · · Score: 1

      You can construct scenarions where you need "\\\\\\\\" to express a single backslash but that's usually avoidable. Think "I dynamically call a shell script that calls another script and I forgot to take my pills today".

      Heh. I've done stuff in Javascript that looked like that. Think "open new dialog, write HTML including Javascript containing strings with escaped backslashes". The "right" way to do it would probably have been to put the methods in the parent, but it was nice having some of them in the child's scope so I didn't have to constantly reference the parent window.

      --
      Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
    18. Re:Namespaces by Anonymous Coward · · Score: 0

      Your point is taken 100% as I agree that using "\" for a namespace separator sucks big time. But...

      If you're using a global variable named "n" then in my team you would be sacked on the spot.

    19. Re:Namespaces by Jesus_666 · · Score: 1

      Yeah, dynamically generated JavaScript is also a good way of reaching at least "\\\\".

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
  14. One of these things is not like the OOthers by Ukab+the+Great · · Score: 5, Insightful

    One of these things just doesn't belong

    python:

    myArray.append(myvalue)

    ruby:

    myArray.push(myvalue)

    objective-c:

    [myArray addObject: myvalue]

    smalltalk:

    myArray add: myvalue

    PHP:

    array_push($myarray, $myvalue)

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

      Or...

      PHP:
      $myarray[] = $myvalue;

    2. Re:One of these things is not like the OOthers by edsousa · · Score: 1

      $myarray[]=$myvalue

    3. Re:One of these things is not like the OOthers by Just+Some+Guy · · Score: 1

      Python: myArray.append(myvalue)

      Well, you could do something like:

      >>> a = [1,2,3]
      >>> list.append(a, 4)
      >>> a
      [1, 2, 3, 4]

      and squint until it looks like list_append, but that's kinda silly. And that $myarray[]=$myvalue; syntax? That should be taken out and shot.

      --
      Dewey, what part of this looks like authorities should be involved?
    4. Re:One of these things is not like the OOthers by VGPowerlord · · Score: 1

      Fun fact: arrays are not objects in PHP*. Not surprisingly, this means that they don't have properties or methods.

      *Another poster already pointed out that PHP does have array objects, and having looked, array objects DO have an append method.

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    5. Re:One of these things is not like the OOthers by wumpus188 · · Score: 1

      Is that really PHP-ish way of adding elements to array? Wow...

    6. Re:One of these things is not like the OOthers by xSander · · Score: 0

      One of two ways to do it, yes. PHP is still very much of a procedural language, but PHP 5 is a step in the right direction.

    7. Re:One of these things is not like the OOthers by Anonymous Coward · · Score: 0

      One of these things just doesn't belong

      python:

      myArray.append(myvalue)

      ruby:

      myArray.push(myvalue)

      objective-c:

      [myArray addObject: myvalue]

      smalltalk:

      myArray add: myvalue

      PHP:

      array_push($myarray, $myvalue)

      Does any reading this realize that you cannot push an array...

    8. Re:One of these things is not like the OOthers by amicusNYCL · · Score: 2, Interesting

      One of these things just doesn't belong

      hmm.... let's check the rankings at tiobe.com..

      python: 5.548%
      ruby: 2.692%
      objective-c: 0.134%
      smalltalk: 0.125%
      PHP: 9.921%

      So apparently PHP is the one that is not like the others, because the ranking for PHP is more than the rankings for everything else combined.

      http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
    9. Re:One of these things is not like the OOthers by Anonymous Coward · · Score: 0

      The tiobe stats aren't worth the electrons they're encoded in, even a 50% lead wouldn't be statistically significant with the crappy definitions they're using. You'd do your credibility a favour by refraining from ever linking to it again.

    10. Re:One of these things is not like the OOthers by Dragonslicer · · Score: 1

      Congratulations, you've discovered that PHP is not, has never been, and most likely never will be, a language where everything is an object. Did you also know that myInteger.plus(myOtherInteger) doesn't work in PHP? I am truly in awe of your vast knowledge of programming languages.

    11. Re:One of these things is not like the OOthers by twostix · · Score: 1

      Geez I wouldn't use Python dictionaries and lists as an example to belittle PHPs hash arrays.

      I've developed monstrous apps in both, and working with arrays in Python is like trying to keep a big PHP project maintable. A total PITA.

      Your contrite example forgets about len(myArray), why not myArray.len()? Python's isn't immune from that sort of design on the fly rubbish.

      Does a method pass back a list, or a dict or a list of dicts; who knows it's like a lucky dip! And then there's the terrible Python documentation...I do not wish to have to do ctrl-f on a 10 screen long page that lists five or six semi-related modules to find a method and then be told everything except wtf the method actually does.

      PHP is hardly the only language that makes your brain bleed, Python is *worse*, not to mention it's missing half the stuff any decent scripting language has had for ten years. Such as the 1990s era manner of handling web based apps. Actually having to think about CGI, having to print headers, manual cookie handling. The GOD AWFUL cookie module, the insanity of urllib. Oh that's right nobody actually uses Pythons implementation of *any* of that. To write a Python app for the web you need to install 100MB of one of a million shoddy frameworks, hacked together *custom* 'webservers' and rubbish to do it in a manner even approaching PHPs ease of use in that environment. And what do you end up with after installing and customising and introducing that maintentance nightmare into your world? Python that looks an awful lot like...PHP! It's more trouble than using Java/Tomcat with half the benefits!

      Off to write more Python...

    12. Re:One of these things is not like the OOthers by twostix · · Score: 1

      "example to belittle PHPs hash arrays."

      Doh, I meant *hash tables*

    13. Re:One of these things is not like the OOthers by gullevek · · Score: 1

      perl:

      push(@myarray, $myvalue)

      so???

      --
      "Freiheit ist immer auch die Freiheit des Andersdenkenden" - Rosa Luxemburg, 1871 - 1919
    14. Re:One of these things is not like the OOthers by shutdown+-p+now · · Score: 1

      So apparently PHP is the one that is not like the others, because the ranking for PHP is more than the rankings for everything else combined.

      MySQL is also more popular than Postgres. And VB, at its peak in late 90s, was more popular than Java.

      "1,000,000 lemmings cannot be wrong" is a self-fixing problem - all you have to do is to just sit and wait until they all jump. And then things get back to normal (until the next herd of lemmings comes by).

    15. Re:One of these things is not like the OOthers by Just+Some+Guy · · Score: 1

      Pro-tip: When picking a similar language to demonstrate that the original isn't crazy, don't choose Perl.

      --
      Dewey, what part of this looks like authorities should be involved?
    16. Re:One of these things is not like the OOthers by clone53421 · · Score: 1

      "Push" means add one element to the end, and yes, you can do that if the array can expand.

      --
      Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
    17. Re:One of these things is not like the OOthers by Anonymous Coward · · Score: 0

      Or in ruby:

      myArray << myvalue

      (previously eaten by filters)

  15. Well wouldn't you know by omuls+are+tasty · · Score: 5, Insightful

    In the finest tradition of PHP, they made Unicode behaviour dependent on a setting. Have these people learnt nothing from the past? magic_quotes anyone? Bleh. All languages have their warts, but the amount of bad design decisions in this one is just staggering.

    1. Re:Well wouldn't you know by VGPowerlord · · Score: 4, Insightful

      Stack Overflow has a question from last year titled Worst PHP practice found in your experience?. Earlier today, I submitted the answer whose summary is "The worst practice in PHP is having the language's behavior change based on a settings file."

      Great minds think alike!

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    2. Re:Well wouldn't you know by ukyoCE · · Score: 1

      I'm not that familiar with PHP's unicode behavior, but this is generally the Right Way to phase in new features.

      Version X: does not have feature

      Version X+1: feature is optional, developers can start coding apps with it, and also maintain apps that do not yet support it

      Version X+2: feature is default, developers can still maintain apps that do not yet support it

      Version X+3(or later, if ever): feature is mandatory, apps that do not use the feature must be upgraded or run on unsupported old versions.

      Magic quotes was an unfortunate feature that existed when the language was first created. Their phaseout plan for Magic Quotes is identical to their phase-in plan for Unicode support.

      This sort of phased plan also has the major advantage of not making a feature mandatory or default before it's been well tested and determined to indeed be worth keeping around and making mandatory.

    3. Re:Well wouldn't you know by omuls+are+tasty · · Score: 1

      Version X+1: feature is optional, developers can start coding apps with it, and also maintain apps that do not yet support it

      Right. Except that it's completely out of my hands as a developer. It means that, if I'm to build a distributable app, I need 2 versions of the same code. Which is a Bad Thing. You know, DRY and all that jazz.

      Magic quotes was an unfortunate feature that existed when the language was first created.

      Are you sure about that? I don't know the history of PHP (I only started using it some 5 years ago) but I don't think that magic quotes existed when PHP was first created. It seems to me as if it was just monkey-patching of a gaping hole caused by a combo of featureless DBMS and the incompetent average developer.

      This sort of phased plan also has the major advantage of not making a feature mandatory or default before it's been well tested and determined to indeed be worth keeping around and making mandatory.

      Ah. So PHP devs need to determine whether having Unicode support is worth keeping around. Great. And they're also wondering if it's worth making mandatory, while they introduce a bunch of other backward incompatibilities. Makes sense.

    4. Re:Well wouldn't you know by omuls+are+tasty · · Score: 1

      Yes, it's also what made Javascript so painful before the dawn of the toolkits.

      Except that I'm not sure if it qualifies as "the worst practice" from a developers point of view, since a developer has no control over it.

    5. Re:Well wouldn't you know by ukyoCE · · Score: 1

      1- Any time there's a new feature you need to code a version with and without it, or you're cutting out the bulk of users still on the old version of code. PHP's more gradual approach is no different.

      2- Magic Quotes wasn't in version 1 i'd bet, but it was in there by the time php became popular.

      3- It's the implementation not the feature. If they enable it by default they'll have to stick with the implementation and maintain backwards compatibility. If they slow acceptance a bit, they have a chance to make changes without effecting as many users. For instance changing argument order before it would majorly break backwards compatibility and become an idiotic thing to change.

    6. Re:Well wouldn't you know by omuls+are+tasty · · Score: 1

      1- Any time there's a new feature you need to code a version with and without it, or you're cutting out the bulk of users still on the old version of code. PHP's more gradual approach is no different.

      Maybe we disagree with the concept of a "feature". A new feature was adding a different syntax for constructors in PHP5. You can choose to use it, or you can choose not to use it. A "feature" that breaks my code is not a feature, it's introducing backwards incompatibility. Backwards incompatibility = bad. Furthermore, the behaviour of my code changes from one installation to another. That's also not a feature, that's lack of portability.

      3- It's the implementation not the feature. If they enable it by default they'll have to stick with the implementation and maintain backwards compatibility. If they slow acceptance a bit, they have a chance to make changes without effecting as many users. For instance changing argument order before it would majorly break backwards compatibility and become an idiotic thing to change.

      There's no such thing as breaking backwards compatibility "just a little bit". You either break it or don't break it. And any time you create a public API of any sort you are making a commitment to keep it stable. If you're breaking a commitment you better have a damn good reason for it, and make sure that you run out of other viable options.

      Besides, if they're unable to create a reasonable interface to a feature that's been present in most programming languages for a decade, they should perhaps think of switching careers.

  16. It does Exist by PowerVegetable · · Score: 1

    There is an ArrayObject class in PHP http://us2.php.net/manual/en/class.arrayobject.php

    But like a lot of the stuff in the SPL, no one ever uses it (including me). I'm not sure why.

  17. New To This version by Anonymous Coward · · Score: 0

    Now we've made it impossible for stupid people to turn on register_globals - instead if you try to turn it on you get the message ERROR(Id-10-T) -- PHP-RTFM.

  18. Working Link by pdragon04 · · Score: 1

    Link in original article is returning 404. I think this is it: http://www.ibm.com/developerworks/opensource/library/os-php-future/

    1. Re:Working Link by Burkin · · Score: 1

      No, that isn't the link from the article. What you linked is a year old, the link from the article was published yesterday.

    2. Re:Working Link by VGPowerlord · · Score: 2, Funny

      I hate to say it, but this wouldn't be the first time on /. when an article was submitted with a link that was a year or more older and the article made it to the main page. Particularly since the article the GP linked to is a year old to the day.

      I can only imagine the submitter/approver looked at the date, say May 6th, and went "OMG, that's today!!!111"

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    3. Re:Working Link by Burkin · · Score: 1

      But that's not what happened. IBM seems to have pulled the article that was linked in the summary due to some unknown reason. The date on it was May 5th 2009

  19. Cry me a river by SmallFurryCreature · · Score: 2, Interesting

    Staying up to date is part of doing business. Would you use a cab that still used horses? Get on a steam train with open box carts?

    While progress for progress sake can be overrated the simple fact is that we learn from mistakes and improve on the stuff we make. There comes a time when being conservative turns you into a technical ludite and as a tech company you got to ask yourself, is this worth it?

    Is there a business in supplying coal for instance? Some people still heat their houses with it, but does that mean YOU as a business man have to run a business to supply them?

    Ask yourself, how much time does it cost you to keep the people happy who want PHP4 and how much that same time could have earned you in business from PHP5 customers.

    Go into your local shopping district and you can probably find stores that still cater to people who haven't moved on, who still do their shopping at the corner store. It is quit fun actually, but who would you rather be. The owner of a corner store struggling each day to pay the bills, or the founder of Albery Heyn, the corner store that made it big?

    The hardest thing a good business man has to learn is to learn which customers to let go.

    --

    MMO Quests are like orgasms:

    You may solo them, I prefer them in a group.

    1. Re:Cry me a river by Phroggy · · Score: 1

      Is there a business in supplying coal for instance? Some people still heat their houses with it, but does that mean YOU as a business man have to run a business to supply them?

      No, but it does mean if YOU choose not to supply them with coal, somebody else will.

      The parent isn't complaining because he doesn't want to stay up to date. He's complaining that they have a lot of customers who don't want to stay up to date, and there's nothing he can do about that except stop taking their money.

      Ask yourself, how much time does it cost you to keep the people happy who want PHP4 and how much that same time could have earned you in business from PHP5 customers.

      Unfortunately, turning away PHP4 customers doesn't mean more PHP5 customers will suddenly sign up. They are currently supporting both, and while of course there is a cost associated with continued support of PHP4, presumably they have already determined that the revenue from their continued business outweighs the extra cost. In fact, by offering consulting services for customers using PHP4 who have problems, they could make even more profit.

      --
      $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
      $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
    2. Re:Cry me a river by Anonymous Coward · · Score: 0

      This is why when I upgraded to .NET 3.5 from .NET 2.0 all my stuff worked without a problem. Oh wait, wat?

    3. Re:Cry me a river by dotgain · · Score: 1

      The hardest thing a good business man has to learn is to learn which customers to let go.

      Yes, apparently it is. A dollar is a dollar, PHP4 or 5.

    4. Re:Cry me a river by Ihmhi · · Score: 1

      Did you read the parent's comment at all?

      I don't think his company has any problems writing new sites in PHP5. It's the existing sites that are coded in PHP4 that are the problem because it would take a lot of man hours (and thus a fat chunk of change) to port them over.

      What is his company supposed to do, spend thousands of man hours upgrading all of their customers' websites for free out of the goodness of their hearts?

    5. Re:Cry me a river by eck011219 · · Score: 1

      Moreover, most customers with a CMS don't want to think about the current version of the underlying programming language of their CMS, they want to sell loofas or t-shirts or whatever. Convincing a client that they need to buy x hours of your time to upgrade them is very difficult if they feel that things have been running along smoothly up until now.

      I'm not saying you don't need to do it, but it's certainly hard to sell. As often as not, I end up eating these kinds of charges because I'd burn more hours explaining it than I would on the upgrade.

      --
      It is pitch black. You are likely to be eaten by a grue.
    6. Re:Cry me a river by daveime · · Score: 1

      The thing is, when horse-and-carts became automobiles, human beings weren't required to rewrite their own biology, or grow an extra arm because the car designer moved all the controls behind the seat.

      But every "upgrade" in just about every language I've come across usually requires massive rewrites or horrible conversion utilities that munge your once perfectly working code into a mess of spaghetti soup.

      This breaking backward compatibility is just a way to sell more conversion software / services. Why should essentially a collection of cumulative security packages (once marketed as a new version), suddenly decide to reverse the syntax, or decide to use a different concatenation operator (I'm looking at you Perl 6).

    7. Re:Cry me a river by trparky · · Score: 1

      It's easy, tell them you either upgrade now and be able to sleep soundly at night or you sleep lightly while worrying if their web site is going to have all of the user data stolen and then hacked to shreds. I was able to take a PHP-powered web site and transition it from PHP4 to PHP5 with no issues whatsoever. I don't know what you guys are talking about.

    8. Re:Cry me a river by Anonymous Coward · · Score: 0

      "I don't know what you guys are talking about." ... I guess you really are incredibly inexperienced.

  20. Pulled by IBM by iliaal · · Score: 1

    The article got thankfully pulled by IBM already, to correct a number of in-accurate statements *hopefully*

  21. 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"
  22. Indeed it does not by SmallFurryCreature · · Score: 2, Insightful

    Market share: PHP 50%, ASP 49%, rest perl.

    When PHP and ASP don't totally dominate the job listings, please come back to me again. In the meantime I know which of the function calls pays for my food.

    Oh and $array[] = $value;

    Coding, you should learn it.

    --

    MMO Quests are like orgasms:

    You may solo them, I prefer them in a group.

    1. Re:Indeed it does not by PCM2 · · Score: 3, Interesting

      Oh and $array[] = $value;
      Coding, you should learn it.

      Or maybe the PHP designers should, cuz I know quite a few programming languages and that syntax does not look like "append a value to an array" to me. It looks more like some kind of borked pointer assignment, or a way or re-initializing an array to contain a single value.

      --
      Breakfast served all day!
    2. Re:Indeed it does not by LKM · · Score: 1

      Oh and $array[] = $value;

      Coding, you should learn it.

      Man, that quote should have been in Alanis's song.

    3. Re:Indeed it does not by Anonymous Coward · · Score: 0

      Competent developers are offered jobs that are actually interesting and don't have to worry about language market share on monster.com. I'd switch professions if I had to pump out CRUD business apps with PHP.

      PHP "developers" are basically one notch above "HTML" coders.

    4. Re:Indeed it does not by Anonymous Coward · · Score: 0

      1998 called, they want their market share statistics back.

    5. Re:Indeed it does not by amicusNYCL · · Score: 1

      Competent developers are offered jobs that are actually interesting and don't have to worry about language market share on monster.com.

      Actually, a competent developer is able to apply their skills to any job regardless of language. If PHP is the language du jour today, great, if everyone loves Python tomorrow, no problem. C? Sweet, let's party like it's 1979.

      It seems to me like the people bitching are the ones who don't want to have to learn something else, or are bitter because they see a bunch of people who read tutorials and nothing else taking jobs from them. I've got a computer science degree, and I've got a salaried job having a lot of fun creating some really cool PHP/ajax applications.

      I'm sorry that you're only able to find offers for CRUD business applications.

      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
    6. Re:Indeed it does not by Almahtar · · Score: 1

      I can see why you'd think that if you hadn't been using PHP. For a long time PHP has supported this:
      $myArray['arbitraryString'] = $value;
      Or:
      $myArray[$arbitraryNumber] = $value;

      It would create that member of that array and assign the value. So since I'm allowed to put anything I want between the [] and it'd work, it makes sense that if I didn't care what the index value was I could leave it blank and one would be automatically assigned.

    7. Re:Indeed it does not by neuroscr · · Score: 1

      But if all languages worked and operated the same, what's the point of having more than one language?

    8. Re:Indeed it does not by shutdown+-p+now · · Score: 1

      But if all languages worked and operated the same, what's the point of having more than one language?

      There are many ways for languages to be meaningfully different (e.g. imperative vs functional, or lazy-by-default vs eager-by-default, or well-defined order of evaluation vs unspecified order of evaluation). But there's no reason to be different just for the sake of being different, especially when the end result is simply confusing.

    9. Re:Indeed it does not by Jesus_666 · · Score: 1

      But there's no reason to be different just for the sake of being different, especially when the end result is simply confusing.

      Then why does Python exist? It doesn't behave like I (speaking C++/Java/Obj-C/PHP) expect it to so it must obviously be wrong. And dont even get me started about Prolog, that one doesn't even have proper string manipulation routines.

      Hint: Languages whose design principles you don't know might behave differently from familiar languages for a reason. In PHP's case, the primtive arrays actually are maps - you can assign any value to any key. As a convenience, when you don't care about the key you don't have to give one and PHP picks one for you.

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
    10. Re:Indeed it does not by shutdown+-p+now · · Score: 1

      Then why does Python exist? It doesn't behave like I (speaking C++/Java/Obj-C/PHP) expect it to so it must obviously be wrong. And dont even get me started about Prolog, that one doesn't even have proper string manipulation routines.

      That I explained in the first half of my post, which you've conveniently omitted.

      Hint: Languages whose design principles you don't know might behave differently from familiar languages for a reason. In PHP's case, the primtive arrays actually are maps - you can assign any value to any key. As a convenience, when you don't care about the key you don't have to give one and PHP picks one for you.

      I know how PHP arrays work, thank you - I've developed in that language in the past. It's still no excuse for devising a syntax as weird as it is for what is, anyway, an "append to end" operation as far as the programmer is concerned. It should be noted that there are other languages that use associative arrays as their sole data structure - JavaScript and Lua, for example - and so they had to deal with this problem as well. It might be interesting to observe how they did it:

      // JavaScript
      a = new Array(1, 2, 3);
      a.push(4);

      -- Lua
      t = { 1, 2, 3 }
      table.insert(t, 4)

      I'd say that both approaches above are far, far more clear than PHP's weird a[] = x syntax.

    11. Re:Indeed it does not by badkarmadayaccount · · Score: 1

      array_push ($myarray, $myvalue)

      That good enough? Valid PHP, IIRC.

      --
      I know tobacco is bad for you, so I smoke weed with crack.
    12. Re:Indeed it does not by shutdown+-p+now · · Score: 1

      That good enough? Valid PHP, IIRC.

      Yes, it's okay... if only the array_* functions had consistent argument order. Consider:

      array_push ($array, $var)
      array_search ($value, $array)
      array_filter ($array, $callback)
      array_pad ($array, $pad_size, $pad_value)
      array_map ($callback, $array)
      array_reduce ($array, $callback)

      So $array argument jumps back and forth seemingly at random, and, funnier still, "map" and "reduce" ended up with reversed argument order.

    13. Re:Indeed it does not by badkarmadayaccount · · Score: 1

      That is a separate issue, and something easily fixable, even with macros.

      --
      I know tobacco is bad for you, so I smoke weed with crack.
  23. Wow. Scintillating. by Anonymous Coward · · Score: 0

    So the "major" new features of PHP6 are UTF-8 and Namespaces. With a horrible \ delimiter. Yawn.

    C# and VB have had UTF-8 and Namespaces for many years. Meanwhile C# and VB in .NET 4.0 are getting dynamic keyword support, anonymous methods (VB), co- and contra-variance, automatic properties (VB), and "From" keyword list/dictionary initialization (VB) as soon as this year. And I'm not just crooning for Microsoft, either. Python has shown much more improvement than this over the years.

    I was hoping after the poor OO implementation of PHP5 that PHP6 might incline me to develop in it again, but after seeing this, no thanks.

  24. Lipstick on a Pig by Anonymous Coward · · Score: 0

    Until they throw out ZE2 and redo a new ZE3 most or all of the features of php6 are going to feel hack-ish.

    Classes are not a first-class data type, so you will never be able to do real casting:

    $mouseEvent = (MouseEvent)$event;

    I wish someone would port php6 over to parrot or python runtimes. I've contributed to extensions for both PHP and Python (qt, pygame) and Python's engine source code is 100 times easier to understand.

  25. FTFY by PCM2 · · Score: 1

    All languages have their warts, but the total lack of design decisions in this one is just staggering.

    --
    Breakfast served all day!
  26. Oh thanks heavens... by Anonymous Coward · · Score: 0

    ...I've moved away from PHP!
    Most other platforms are fairly secure as long as you don't mess up. With PHP it's the other way around - you've got to be extra careful with every line you write because there are possible holes everywhere.

    Take email header injection for example - with PHP this is actually a real problem that you as a developer have to care about. On other platforms, with sane APIs, this would never be an issue.

  27. Not enough by LKM · · Score: 1

    To really fix PHP, every existing application would have to be broken. And I'm not being sarcastic or trying to make a joke. I use PHP myself for a lot of projects, but this is one of those languages where you really can't make excuses: it's just broken, and fixing it would require changing the language in ways that would break every existing app.

  28. RC2 is out by Bananenrepublik · · Score: 1

    Bad timing :)

    RC2 just came out link

  29. This is a lie! by LKM · · Score: 1

    I have credible sources telling me that the Duke Nukem Forever site will, in fact, be written in Perl 6. Furthermore, DNF's mod scripting system runs on Parrot.

    1. Re:This is a lie! by Kronik+Gamer · · Score: 1

      I have credible sources telling me that Duke Nukem Forever itself will be written in PHP6. It will take as long to start up the game as it did to develop it.

    2. Re:This is a lie! by LKM · · Score: 1

      Also, the whole game will be one huge function littered with goto statements.

    3. Re:This is a lie! by Anonymous Coward · · Score: 0

      It would be, unless you were looking at the source code.

    4. Re:This is a lie! by badkarmadayaccount · · Score: 1

      With in-line COBOL, FORTRAN and ALGOL 68, COMEFROM statements, passing labels as arguments, ActionScript and APL for flow control, and lots of ALTER.

      --
      I know tobacco is bad for you, so I smoke weed with crack.
  30. Its like fast food.. by greywire · · Score: 4, Funny

    PHP: its like fast food..

    You know its bad for you...

    You feel like crap after eating it...

    But damnit, its right there, oh so conveniently located on the way to work, and sometimes a greasy cheeseburger just hits the spot, even though you know you'll pay for it later in heartburn and much later in high cholesterol and love handles, even though right now its really cheap on the wallet.

    Its a guilty pleasure.

    And while you're sucking down that greaseball burger, you see the local soup and salad restaraunt and think "next time, I'll eat right.."

    But come the next day and you see that taco joint and..

    --
    -- Senior Software Engineer, Attorney appearance services, locallawyerapp.com.
  31. Uploading progress bars? by Yvan256 · · Score: 1

    Will PHP6 finally support easy-to-make upload progress bars? Because with PHP5, unless you have total control over the server, it's almost impossible to do.

    And all the "hacks" I've seen so far are Perl script who never seem to be doing their job on the servers I test them on (the files do upload but the progress bar never updates during the actual uploading of the file).

    1. Re:Uploading progress bars? by gordyf · · Score: 1

      Why don't *browsers* give us upload progress bars? The browser is doing the uploading, so it only makes sense for it to show a progress bar.

    2. Re:Uploading progress bars? by Yvan256 · · Score: 1

      Indeed, however it's more realistic to ask for a progress report function in PHP than to ask for a progress upload bar from all the browsers on all the platforms.

      Especially Internet Explorer (unless it already has one, I honestly don't know). And if it does, than shame on Firefox, Opera and Safari for not having such a feature.

    3. Re:Uploading progress bars? by elbobo · · Score: 1

      IE has a progress bar (or at least, some versions have had).

      All the other browsers (to my knowledge) do not.

      And yes, shame on them. It's absurd. The browser knows how big the file is and how much it's sent. IT CAN PROVIDE A FUCKING PROGRESS BAR.

      But no. Instead web devs have to write absolutely absurd hacks around this basic missing feature.

    4. Re:Uploading progress bars? by iluvcapra · · Score: 1

      This really isn't something that should be in the core language... but then again PHP has friggin' soundex functions in the core language, so what do I know that they don't?

      Doesn't Cake or some other PHP framework provide something like this?

      --
      Don't blame me, I voted for Baltar.
    5. Re:Uploading progress bars? by dudeinthedark · · Score: 0

      While the file is uploading, have the users browser use ajax to open another script compare the current size of the file to the total size it should be?

    6. Re:Uploading progress bars? by Joebert · · Score: 1

      I just use Flash uploaders when I can now.

      Not only has the progress of an upload been easily obtainable for years now, but now you can screen files BEFORE sending them to the server based on filetype and filesize.

      --
      Wanna fight ? Bend over, stick your head up your ass, and fight for air.
    7. Re:Uploading progress bars? by elbobo · · Score: 1

      That's not the point though. Yes, there's workarounds we can do as developers. But the browsers have all the relevant information already, and are the best and most sensible and logical candidates for presenting that information to the user.

      The fact that we've been doing workarounds for so many years is, frankly, absurd.

    8. Re:Uploading progress bars? by abigsmurf · · Score: 1

      I'm trying to think how it could be done.

      Maybe doing something with the header that lets PHP return a "block/percentage" done message. You then have it so that php outputs a series of characters after writing out a tag and having javascript use that to count the characters as they're being outputted to create a progress bar.

    9. Re:Uploading progress bars? by Joebert · · Score: 1

      I wouldn't call Flash a workaround.

      --
      Wanna fight ? Bend over, stick your head up your ass, and fight for air.
    10. Re:Uploading progress bars? by elbobo · · Score: 1

      I would.

      Flash has been a place keeper / workaround for missing browser features for years now. Once browsers can do everything properly themselves, we'll no longer need Flash, and we'll be better for it.

    11. Re:Uploading progress bars? by Joebert · · Score: 1

      Actually, Flash hasn't been a work around as much as it's been a source of ideas to be implemented in browsers.

      --
      Wanna fight ? Bend over, stick your head up your ass, and fight for air.
    12. Re:Uploading progress bars? by elbobo · · Score: 1

      I'd say both. Just because it's inspired browser features, doesn't mean that Flash has ever been The Right Way.

    13. Re:Uploading progress bars? by Yvan256 · · Score: 1

      Except that with PHP you can't specify an upload directory or filename, it's all internal with random temporary filenames while uploading.

      The only real work-around that (is supposed to) work is to upload the file to something else than PHP (usually Perl), however all the Perl scripts I've tested on the servers I use (and don't control) just won't update anything until the file is completely uploaded (and no, disabling/flushing the buffers also doesn't work for some reason).

  32. What are you talking about? by numbski · · Score: 1

    It's been broken over all for years now. I'd try to do:

    use strict;

    and it always fails. WTF? :P

    --

    Karma: Chameleon (mostly due to the fact that you come and go).

  33. Where is the APC, (here is correct TFA address)? by barwasp · · Score: 1

    So here is the correct TFA address

    I have been hoping (and reading that) the coming PHP6 would arrive with a built-in PHP accelerator APC - is it? Or is there a silent change of plans?

  34. Javascript anyone? by spanky+the+monk · · Score: 2, Interesting

    I would love to see JavaScript on the server side. It's already way more powerful than php5 with (superior) prototypal oo, higher order/first class functions and many other meta-programming abilities.

    All it needs is some good libraries. There are people already working on this. Soon... soon.

    1. Re:Javascript anyone? by brettz9 · · Score: 1

      For those who want to work in PHP, one can already work JavaScript-style (as of PHP 5.3), or even JavaScript proper... (While I'm at it, I may as well mention our bringing PHP to JavaScript (PHP functions implemented in JS, that is), hopefully making SSJS more appealing (though still requiring host support). Help welcome!...)

  35. Why? Just, why? by Requiem18th · · Score: 1

    I develop PHP applications for a living and all I can say is, why bother?

    If was to fix PHP the result would be practically like python, but that would be incompatible! But PHP6 will be incompatible anyway, what's the point?

    For new projects I recommend any other tool, I'd say Django or Rails but even ASP could do better.

    For legacy applications you can't switch to PHP6 or the legacy code will fail.

    --
    But... the future refused to change.
  36. Re:Where is the APC, (here is correct TFA address) by barwasp · · Score: 1

    Briefly: Damn this isn't the right address

    Longer version: Original TFA link didn't/doesn't work and the firefox didn't find on this page strings "URL" or "address" for pointing out the correct article link. BUT I saw that "working link"-post... So I read it and see nothing of APC is mentioned there( which is the most expected thing for me on PHP6). So... in doing a public a favor I repost the above "year old link" and wonder about APC. OK, the link isn't right thus there's still hope for APC to be there - maybe & sorry.

  37. Broken Link in Summary by Udigs · · Score: 5, Informative
    1. Re:Broken Link in Summary by barrylb · · Score: 1

      Thanks, and now I wonder if people realize this article is dated from one year ago... "06 May 2008".

    2. Re:Broken Link in Summary by Anonymous Coward · · Score: 0

      06 May 2008

      Old news for nerds.

  38. 2015 article? by CarlosM7 · · Score: 1

    When I try and open the link on TFS, I get an error to the effect that it can't be displayed. Then I did a search for "php v6", and clicked on sort in descending order, and the first entry is dated to 21 december 2015.

  39. Did we just /. IBM? by Trogre · · Score: 1

    Our apologies...

    The page you requested cannot be displayed

    Suggested actions

            * If you are looking for IBM Systems or Grid computing content on developerWorks, that content is no longer available. We suggest that you visit the following links for related content: IBM Systems, Systems, servers, and storage, or IBM Grid computing.
            * If you typed the address, make sure the spelling is correct.
                Note: Most addresses are also case sensitive.
            * If you clicked on a link, there may be a problem with that link. You can use "Get assistance" below.
            * To navigate the IBM developerWorks Web site, start from IBM developerWorks.
            * Use the search box at the top of this page.
            * Or return to the previous page.

    --
    "Nine times out of ten, starting a fire is not the best way to solve the problem." - my wife
  40. C++ has this too by ooloogi · · Score: 1

    C++ does have classes, integrated associative arrays (std::map), variable-length arrays (std::vector) and usable string manipulation (std::string). STL components are a standard part of C++. Then, together with the Boost library, you pretty much have everything that the PHP runtime library has.

    There are reasons why PHP has popularity over C++, but these technical issues aren't it.

    1. Re:C++ has this too by dgatwood · · Score: 1

      C++ has those things, but they use a very non-C-like syntax. They are also nowhere near as well integrated into the language as PHP arrays are. For example, in PHP, I can write:

      foreach ($arrayB as $value) {
      printf("The value is %d\n", $value);
      }

      In STL:

      void printValue(const int &i) {
      printf("The value is %d\n", i); // or use cout
      }
      ...

      for_each(arrayB.begin(), arrayB.end(), printValue);

      I guess this will get cleaner if/when something approaching closures are supported universally, but for now, it's a mess. If you want to write it without polluting your namespace with an extra function, you can't use for_each, so you get an even uglier mess:

      for (map<string,int>::iterator i = arrayB.begin(); i != arrayB.end(); i++)
      {
      cout << "The value is " << i->second << endl;
      }

      It just gets uglier from there.

      --

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

  41. Polishing The Turd? by asackett · · Score: 1

    I avoided PHP as long as I could, finally was compelled to give in and become proficient in it. Now I want to dig out those parts of my brain that know about PHP, and particularly those that store memories of the miseries I've experienced in dealing with the work of "coderz". Dig them out with a spoon that's seen a few laps around the garbage disposer and hasn't been washed since.

    Give me Perl, mod_perl, and Catalyst any day.

    --

    Warning: This signature may offend some viewers.

  42. Re:SPOILER ALERT by daveime · · Score: 1

    The funny thing is, Perl apps that were written ten or even fifteen years ago still work. PHP code that was written LAST WEEK is already broken.

  43. Just use Pear PHP_Compat by hofmny · · Score: 1

    For all those people complaining about PHP 4/5 issues.. really?, REALLY!? Not to sound like a troll here, and KARMA aside,but cmon. There are not that many changes at all that can't be fixed even on huge applications.

    Haven't any of you people heard of php_compat? Simply install PHP_Compat library from pear:
    #pear install php_compat
    downloading PHP_Compat-1.5.0.tgz ...
    Starting to download PHP_Compat-1.5.0.tgz (44,133 bytes)
    ............done: 44,133 bytes
    install ok: channel://pear.php.net/PHP_Compat-1.5.0


    Then in PHP
    require_once 'PHP/Compat.php';
    PHP_Compat::loadFunction('file_get_contents');


    This should solve your integration issues with PHP5. http://pear.php.net/package/PHP_Compat

  44. It's like BAD fast food.. by Haeleth · · Score: 1

    Who goes to Cheapscum's Ratburgers when there's a Burger King next door?

    That would be like using PHP when Perl, Python, and Ruby are all just as quick, just as easy, far better designed, and far more conducive to writing robust and maintainable code...

    1. Re:It's like BAD fast food.. by Jesus_666 · · Score: 1

      Because in practice PHP is quicker and easier. "Well-designed" is meaningless; OSI also was well-designed and it still quoted in theory - but not really used in practice.

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
    2. Re:It's like BAD fast food.. by greywire · · Score: 1

      I was thinking PHP is probably most like McDonalds. Perl is probably like Burger King (have it YOUR way..). I could probably spend a lot of time thinking of food analogies for all the languages...

      --
      -- Senior Software Engineer, Attorney appearance services, locallawyerapp.com.
  45. Just wait till Perl 6 comes out! by Anonymous Coward · · Score: 0

    Then you'll be sorry

  46. 404 by mirabilos · · Score: 1

    I first wondered IF I want to actually read about it
    then I said what the hey, lets look at it, know your
    enemy and all that.

    All I get is an IBM Notice:

    Our apologies...
    The page you requested cannot be displayed

        Suggested actions
        If you are looking for IBM Systems or Grid computing content on developerWorks, that content is no longer available. We suggest that you visit the following links for related content: IBM Systems, Systems, servers, and storage, or IBM Grid computing.
    If you typed the address, make sure the spelling is correct.
    Note: Most addresses are also case sensitive.
    If you clicked on a link, there may be a problem with that link. You can use "Get assistance" below.
    To navigate the IBM developerWorks Web site, start from IBM developerWorks.
    Use the search box at the top of this page.
    Or return to the previous page.

    Get assistance
        To tell us about a broken link, go to the IBM developerWorks Feedback page.

    404 Not Found

    --
    My Karma isn't excellent, damn it! (And /. still does not get UTF-8 right in 2012. Wow.)
  47. Location, location, location... by weston · · Score: 1

    That would be like using PHP when Perl, Python, and Ruby are all just as quick, just as easy, far better designed, and far more conducive to writing robust and maintainable code...

    Not quite, particularly Python and Ruby. There are several ways in which PHP tends to be convenient, and they're all about easy availability. Or as they say in the real estate business, location, location, location.

    1) PHP is on very nearly *every* general Unix hosting package, and most Windows hosting packages. Python and Ruby interpreters may or may not be on the system... much less the popular frameworks. Perl's pretty much everywhere Unix as well, so there's a kind of parity for it, but...

    2) You don't need your files in some particular layout or in some weird cgi-bin directory. If it's got a .php extension on it and is in the web server's document root, it gets run.

    3) You can just sprinkle it on in with the HTML output it's part of, especially convenient if it's just a tiny, little bit of logic in a sea of markup, right?

    None of this is to say anything about PHP's general suitability for web applications (hey, you know you've got it bad if *Perl* is beating you out for conducivity to writing robust and maintainable code ;) ... just to point out why it's often easily and sleazily convenient in a way the others aren't.

  48. broken link by Anonymous Coward · · Score: 0

    the link is broken?

  49. perl 6 by parisjackson · · Score: 0

    How is it that php is already putting out version 6 but we've been waiting forever for Perl 6. C'mon Larry, put it out already. I'm afraid I'll be playing Duke Nukem forever and watching Boondock Saints 2 before Perl 6 comes out.

  50. Can someone remove the "programming" tag, by Hurricane78 · · Score: 1

    and replace it with the "spaghettiscripting" tag?
    Because after having to use it for 5 years at my job, and having used many real languages at home and at other jobs, I must say that that is all it is good for.
    The interpreter itself is a total joke. Just as bad as the code it interprets.

    I could manage to do things like put random clear text in the middle of the code (where a statement should have been. And the interpreter did not even complain or notice.
    put a simple string without quotes of any kind inside an expression, and PHP acts as if it were a proper string. Of course it even gets hairier, when the whole automatic number-string-conversion comes in. And the each() "function". Heck, it seems not even the developers know the difference between a reserved word, and a function. And most "programmers" who use it, seem no not care that "if" is not a function. They write "if(something) { bla }" but "somefunction (parameter)", as if it were a reserved word. I have even seen it in the documentation for PHP itself. There is so much madness in that thing, that I would deny a job offer, just because this were their language of choice.
    And don't ask me about the PHP5 in-class special methods (the ones starting with "__"), because I might pull my hair out, when remembering how just plain wrong the concept of them was, when trying to implement standard features, that PHP somehow just didn't do.

    It is simply unnecessarily hard to code properly in PHP. So why do it at all? It has no benefit over Python, JSP, or Ruby. Which in my eyes leaves no reason.

    --
    Any sufficiently advanced intelligence is indistinguishable from stupidity.
  51. You Can't Get There From Here by jman.org · · Score: 1
  52. Big Fish Down by Tablizer · · Score: 1

    Wow, we slashdotted IBM, the biggest server company in the world. That's like beating the Lakers, Celtics, and Cavaliers all in one day.

  53. Try Jaxer? by Webapprentice · · Score: 1

    I saw this. It requires you to install an engine to your web server (like Tomcat).
    http://aptana.com/jaxer