Slashdot Mirror


Changes In Store For PHP V6

An anonymous reader sends in an IBM DeveloperWorks article detailing the changes coming in PHP V6 — from namespaces, to Web 2.0 built-ins, to a few features that are being removed.

68 of 368 comments (clear)

  1. Magic Quotes Removed by iamhigh · · Score: 2, Informative

    Citing portability, performance, and inconvenience, the PHP documentation discourages the use of magic_quotes. It's so discouraged that it's being removed from PHP V6 altogether, ... ... If you're using magic_quotes to escape strings for database calls, use your database implementation's parameterized queries, if they're supported. If not, use your database implementation's escape function, such as mysql_escape_string for MySQL or pg_escape_string for PostgreSQL. This was discussed just a few days ago in the some what wrongly titled 500 Thousand MS Web Servers Hacked
    --
    No comprende? Let me type that a little slower for you...
    1. Re:Magic Quotes Removed by robo_mojo · · Score: 3, Insightful

      So does this mean that if you are using magic quotes and you upgrade to PHP6, suddenly you will become vulnerable to SQL injection attack? Wow, I'd consider that to be a major regression, then.

    2. Re:Magic Quotes Removed by jacksonj04 · · Score: 2, Informative

      And even more irritatingly, mysql_escape_string() has been deprecated as well. You should use mysql_real_escape_string().

      --
      How many people can read hex if only you and dead people can read hex?
    3. Re:Magic Quotes Removed by The+MAZZTer · · Score: 2, Insightful

      I hope they have some sort of protection against that; specifically, if you have magic_quotes turned on in php.ini (or whatever the linux equivilant is) PHP should refuse to start, perhaps logging an error message which explicitly tells the webmaster magic_quotes is no longer supported, and that it must be turned off, and the possible consequences of using old scripts designed to work with magic_quotes on. This forces the webmaster to actually go into the config file and turn magic_quotes off, and if they didn't fix their scripts or tell their clients to do so it's their own fault. And of course if they have badly configured security, this could mean even bigger consequences, but this is possible even with magic_quotes, depending on the scripts and holes in them. A separate message for safe_mode (also scrapped for 6) would also put the consequences of not properly setting up user permissions and the permissions of the account running the web server in big bold letters.

      If they do something like that, no-one can really say they weren't warned, since a webmaster would actually have to go in and turn it off, and would be told exactly what could happen if they don't take the proper steps.

      A friend of mine is happy these two settings are being killed, as am I. It can be tough to code with the restrictions put in place by safe_mode and magic_quotes, which as I understand are just to cater to lazy irresponsible server admins and lazy irresponsible programmers, respectively. Although safe_mode does serve a legitimate purpose since currently all scripts, regardless of which user owns it, are run under the permissions of the webserver user. This strikes me as more fo a webserver problem than a PHP problem, though. Not sure how much the PHP team could do... except for maybe safe_mode.

      To end my little rant, here's a helpful bit of code pulled from the pastebin source (GPL) to combat magic_quotes in _GET and _POST and _COOKIE:

      // magic quotes are anything but magic - lose them!
      //
      if (get_magic_quotes_gpc())
      {
      function callback_stripslashes(&$val, $name)
      {
      if (get_magic_quotes_gpc())
      $val=stripslashes($val);
      }


      if (count($_GET))
      array_walk ($_GET, 'callback_stripslashes');
      if (count($_POST))
      array_walk ($_POST, 'callback_stripslashes');
      if (count($_COOKIE))
      array_walk ($_COOKIE, 'callback_stripslashes');
      }
    4. Re:Magic Quotes Removed by Just+Some+Guy · · Score: 5, Funny

      So does this mean that if you are using magic quotes and you upgrade to PHP6, suddenly you will become vulnerable to SQL injection attack?

      Of course not! Since no one has been stupid enough to directly insert submitted strings into SQL before sending it to the server for at least 5 years now, this won't affect any modern code in the slightest.

      --
      Dewey, what part of this looks like authorities should be involved?
    5. Re:Magic Quotes Removed by Quietust · · Score: 3, Informative

      So does this mean that if you are using magic quotes and you upgrade to PHP6, suddenly you will become vulnerable to SQL injection attack?
      It would probably be more accurate to say that you will become more vulnerable to SQL injection attacks, since magic_quotes was never 100% foolproof to begin with.
      --
      * Q
      P.S. If you don't get this note, let me know and I'll write you another.
    6. Re:Magic Quotes Removed by TheLink · · Score: 4, Insightful

      But shouldn't you be using mysql_genuine_advantage_escape_string() instead ;).

      It's stupid stuff like that and "Magic Quotes" that make PHP a sad joke.

      Magic Quotes = mixing input layer filtering with output layer filtering = bad. You tend to get data corruption amongst other things.

      Then there's addslashes and friends.

      PHP: "Making The Wrong Ways Easy, and The Right Ways Hard".

      Oh well, I guess php6 is where they are finally trying to do things right now.

      All the pain is because php coders were doing things terribly wrong in the first place. Don't forget the PHP devs were encouraging them to do things wrong for years.

      --
    7. Re:Magic Quotes Removed by WWWWolf · · Score: 3, Insightful

      So does this mean that if you are using magic quotes and you upgrade to PHP6, suddenly you will become vulnerable to SQL injection attack?

      "The Management would like to announce that we're switching to slot-loading CD-ROM drives next week. We will be reserving more burn ointments in the first aid room for the next week or so and the janitor has been instructed to stock extra tissues in the bathrooms, but people who have been using CD-ROM drives as coffee cup holders should seriously stop using them as coffee cup holders ASAP."

      Magic quotes did the wrong fix that incidentally happened to work for some people. The problem was that people had been concatenating (unprocessed) parameters to SQL queries; the right solution would have been to process the quoting in the place where it's supposed to be processed (query parametrisation, right before the query actually goes to the DB, automagically using the method that works appropriately for the DBMS in question), but instead, the developers just said "well, we're letting you continue your dangerous way of coding, here's a band-aid fix".

      I've viewed magic quotes as a feature for legacy code that seriously needs to be fixed: "people used to code completely freaking headlessly back in the day because we didn't have real security back then and this was the ONLY way to do things - this feature is a temporary security feature so that they have time to port their utterly reeking PHP3-era string concatenation crap to use DB-specific quote calls or, far better yet, PDO and prepared statements." Using prepared statements makes the code look more manageable and more in line with the stuff you see in other programming languages, which have used prepared statements for a long time now - porting old code over is more than entirely justifiable.

    8. Re:Magic Quotes Removed by random0xff · · Score: 2, Interesting

      Oh well, I guess php6 is where they are finally trying to do things right now. At which point it will be kind of like Java 1.2 Apart from the amazing amount of PHP code(rs) out there, it seems that PHP is destined to be old skool. With all the buzz around Ruby, Python 3, JavaScript, C# 3, how is PHP going to be a good choice for new projects in the future? Waiting for years to get namespace support while a C# coder now has generics, lambdas, a query dsl and a proper base class library. How is that cool, why be a PHP programmer? So you can have generics by 2012?
    9. Re:Magic Quotes Removed by 615 · · Score: 3, Funny

      Actually, undoing magic_quotes is quite a bit more involved. Some things to consider:

      • - magic_quotes affects more than just GET, POST and cookie data
      • - GPC data may contain arrays
      • - magic_quotes doesn't process the keys of top-level arrays

      Here's an excerpt from my personal library that addresses these issues and more. It works in PHP 4+ (I forget which minor version). Just give me some credit if you use it!

      // magic_quotes_runtime is _like_ magic_quotes_gpc/sybase, except that it
      // applies to return data (from functions)
      ini_set('magic_quotes_runtime', '0');

      // magic_quotes_gpc/sybase cannot be preempted like magic_quotes_runtime; if
      // either is enabled, the damage is already done
      if (ini_get('magic_quotes_gpc') === '1' || ini_get('magic_quotes_sybase') === '1') {
      /**
      * @author Adam Siler <amsiler@icglp.com>
      * @param mixed $value
      * @param bool $top
      * @return mixed
      */
      function undo_magic_quotes($value, $top = true) {
      // unescape strings
      if (is_string($value)) {
      // stripslashes is magic_quotes_sybase-aware
      return stripslashes($value);
      }
      // recurse into arrays
      elseif (is_array($value)) {
      // as described here: <http://us.php.net/manual/en/security.magicquotes.disabling.php#71817>,
      // magic_quotes_gpc (sybase?) does not escape the keys of top-level
      // arrays

      $unescaped_array = array();

      foreach ($value as $key => $array_value) {
      if (!$top) {
      $key = stripslashes($key);
      }

      $unescaped_array[$key] = undo_magic_quotes($array_value, false);
      }

      return $unescaped_array;
      }
      // return other values unaltered
      else {
      return $value;
      }
      }

      $_GET = undo_magic_quotes($_GET);
      $_POST = undo_magic_quotes($_POST);
      $_COOKIE = undo_magic_quotes($_COOKIE);
      $_REQUEST = undo_magic_quotes($_REQUEST);
      $_ENV = undo_magic_quotes($_ENV);
      // etc.

      // other scripts may check the value of magic_quotes_gpc or
      // magic_quotes_sybase and conclude, incorrectly, that GPC data is escaped.
      // this should fix that
      ini_set('magic_quotes_gpc', '0');
      ini_set('magic_quotes_sybase', '0');
      }
  2. Quick summary by Anonymous Coward · · Score: 5, Informative

    ... for those too lazy to RTFA:
    Additions:
    Better Unicode support
    Namespaces! (this is being backported to PHP 5.3)
    SOAP and the XML Writer/Reader modules compiled in and enabled by default (also in PHP 5.3)
    Removals:
    magic_quotes, register_globals, register_long_arrays, safe_mode
    ASP-style short tags ()
    Freetype1/GD1 support
    ereg (use of preg encouraged instead).

  3. Re:Lose the M in LAMP? by i.of.the.storm · · Score: 2, Insightful

    I would think swapping mysql for XML would make things run slower on the whole, especially large databases, but I'm not an expert in that field. XML and mysql really serve different purposes, and I don't think replacing mysql with XML would be a good idea for the vast majority of use cases.

    Oh, and what happened to the spiffy discussion2 stuff? Now comments open in new pages again and I can't reply inline. What's up with that?

    --
    All your base are belong to Wii.
  4. Re:Is this really news? by truthsearch · · Score: 4, Insightful

    Especially since most of the "new" features are either already available or will be included in v5.3. There's literally nothing new here except better Unicode support.

  5. Backwards compatibility is very important by unity100 · · Score: 5, Interesting

    i am servicing around 350+ clients in a small fish web host. even at that small web host, there are a phletora of different scripts, programs that clients are using to conduct their everyday business, their estores, their livelihood. some of them are dependent and locked-in to the software they are using like a small business company that extensively uses ms products is locked into microsoft.

    regardless, backwards compatibility is important for those people. for starters, these are the people who have chosen php as the platform to conduct their business on, making php a de facto dominant language for the web instead of being a small time web language that was used on web savvy, webmasters. the financial impact of this is going to be huge for them, to adopt to that many changes php dev group started to introduce in the span of 1 to 2 years. this is too much.

    you gotta slow down. or you are going to alienate the small business community from using php with what you are doing. if you break a small estore owner's store script every 1.5 years for 'upgrading', the second time you do it they will jump the language ship.

    do not start to become an elitist group out of touch with the people, increasingly caring for nifty programming issues rather than what would the users think.

    1. Re:Backwards compatibility is very important by Anonymous Coward · · Score: 2, Interesting

      And forward innovation is not important? Besides, you wouldn't upgrade all 350+ clients at once and in place? Perhaps having two host accounts, one for php5 apps and one for php6? Just a thought.

    2. Re:Backwards compatibility is very important by MROD · · Score: 4, Insightful

      Many commercial PHP-based systems are only now just changing over to PHP5 from PHP4. (Yes, I know...)

      That's the way life is, I'm afraid. Most people who are depending upon these sites and software have no control over the vendors and definitely don't have the ability of fixing the code themselves.

      Changing the API so greatly and so often in a non-backwardly compatible fashion does cause genuine problems.. and hosting sites can't afford to support multiple versions. Well, not unless they charge their customers too higher price for hosting their pages.

      --

      Agrajag: "Oh no, not again!"
    3. Re:Backwards compatibility is very important by njcoder · · Score: 2, Interesting

      Sounds like you're using mod_php. That's a very insecure way to run php in a shared hosting environment and also doesn't give you the ability to run more than one version of php.

      May not seem like a big deal until some idiot doesn't update his scripts and some script kiddie comes along and you get 350 calls from your clients asking you why there's some terrorist propaganda on their website.

    4. Re:Backwards compatibility is very important by CastrTroy · · Score: 2, Insightful

      I'm with dreamhost, and I still have the option to switch my domain over to 4.4.x, although I'm currently running on 5.2.x. I don't see why a webhost with a large number of customers, couldn't support multiple versions of PHP, especially if there was a large number of customers (at least 10-15%) using that particular version.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
  6. Re:Major version? by eebra82 · · Score: 2, Insightful

    I don't see why this is a major update (5 => 6). If I had a software development business, I would do this if I wanted to push a release a little extra. People don't care as much about decimals as much as they care about entirely new release numbers.
  7. Re:Lose the M in LAMP? by cheater512 · · Score: 2, Insightful

    No.
    XML is a format designed to transmit data between machines, not for data storage.

    Imagine a 50 gigabyte database. I have one.
    Now imagine the same database in XML.
    The size would explode and you suddenly have to seek the entire db for a simple select.

  8. Re:Is this really news? by bcat24 · · Score: 4, Insightful

    There's literally nothing new here except better Unicode support.
    True, but better Unicode support is a very major feature in and of itself. Let's face it, writing a Unicode-enabled Web application with PHP 5 is like hunting wildebeests with a BB gun. It's possible, but it sure ain't easy.
  9. Magic Quotes was never a security function. by gandhi_2 · · Score: 3, Insightful

    It was to protect you from the O'Malleys and O'Connors. The PHP framers were obviously fans of Mel Brooks' film, Blazing Saddles: "We'll take the niggers and the chinks but we don't want the Irish". Or I'm missing something.

  10. Re:Is this really news? by MightyMartian · · Score: 2, Insightful

    I simply can't wait for an even bigger php.ini file to support disabling and re-enabling of deprecated functionality. I've spent several evenings over the last few weeks on a contract to clean up some really bad PHP code, and a good fraction of that time has been spent actually getting a test bed up and running, trying to match the Win32 PHP 5 install I'm forced to work with the Linux PHP4 install on the production server. More than ever before I'm convinced that PHP is the worst major language ever invented, and I'll wager PHP6 only makes it worse.

    --
    The world's burning. Moped Jesus spotted on I50. Details at 11.
  11. Real change by Anonymous Coward · · Score: 3, Insightful

    Make it like a modern language.

    Change . (string concat) to +

    Change -> (pointer-to-member operator) to .

    Done. Huge productivity increases.

    Thank you.

    1. Re:Real change by jyurkiw · · Score: 3, Informative

      Ever wondered why they picked the '.' for a concatenation operator over the trusty '+'?

      PHP is a loosely-typed language.

      The '+' is also the arithmetic operator.

      Is a line of code reading
      $c = $a + $b
      adding $a and $b? or is it concatenating them?

      What if $a = 513 and $b = 4201?
      Are we talking about a phone number? Or am I trying to come up with $c = 4714?

      There was a very good reason for having '.' as the concatenation operator.

  12. Re:Too Little Too Late by thetoadwarrior · · Score: 4, Insightful

    Um, no it's not. It's only downfall is that it's too easy to do powerful things so idiots make dangerous code.

    That is not the language's fault. Not everyone wants or needs a JBoss server or something equally silly for their website. PHP is still very good. Safe programming in PHP just needs to be preached more to the new users of PHP and some of the self taught people who perhaps learned off the net from someone else with little experience rather than a book since all books I've seen cover the basics on safety.

    The only thing that annoys me is the fact it's function naming methods aren't consistent. It shows that it's had input from various places without any thought into standardizing things.

  13. Why PHP sucks by rootpassbird · · Score: 2, Informative

    They've fixed a lot of things that were being complained about under the terms "why php sucks" http://www.google.com/search?q=why+php+sucks .
    Related news is that PHP runs much better now on Windows Server 2008, as per the official Zend statement. But I doubt we will see too many people switch to WISP. This is flambait, agreed.
    Also if you now have a PHP-fed brain with no place for anything else, with the new namespaces-on-steroids (http://www.php.net/manual/en/language.namespaces.using.php) change, you'll likely port slashcode to ::\/\.
    And otherwise refer to <things like="this" /> :-)

    --
    Hackers have long memories. It works both ways.
  14. Re:Too Little Too Late by Falesh · · Score: 2, Insightful

    Don't be daft, PHP 5 is a solid language and it doesn't take much to learn how to write secure code. If you view it from a rookies point of view it could be dangerous, but that doesn't magically make the language crap in the hands of more experienced developers.

  15. Re:Major version? by Splab · · Score: 4, Insightful

    "and a bunch of stuff removed"

    The stuff addressed are some of the widest security holes. On top of that the old way of programming PHP and most guides out there encouraged the usage of these bad functions, getting them totally removed is a huge step forward.

  16. Re:Too Little Too Late by FooAtWFU · · Score: 3, Insightful
    That's not its only downfall. Its other downfalls include some miserable organization and bloated core, though much of this may be attributed to lack of namespace support - which is being remedied, but it's a bit late. There's still a lot of package_name_prefix_with_function_name functions, and I don't see them going away soon.

    Beyond that, and the pervasive "make it easy to do the WRONG thing" un-philosophy, I still haven't heard about it getting lexical scope, closures, and anonymous functions. Of course, this only matters if you're a good programmer (as opposed to merely a Decently Adequate one).

    --
    The World Wide Web is dying. Soon, we shall have only the Internet.
  17. what's with the 'phpsucks' tag? by sneakyimp · · Score: 5, Interesting

    I've noticed that every single article here mentioning PHP is immediately tagged 'phpsucks'. I find PHP incredibly expressive and am always surprised by the incredible variety of libraries/modules/plugins to manipulate graphics, flash, pdfs, to support protocols like SOAP, JSON, etc.

    Perhaps we need an article on 'why php sucks' ?

    1. Re:what's with the 'phpsucks' tag? by FooAtWFU · · Score: 3, Interesting
      You mean like this?

      It's not the lack of modules that people complain about. PHP is excessively convenient, if nothing else. :)

      --
      The World Wide Web is dying. Soon, we shall have only the Internet.
    2. Re:what's with the 'phpsucks' tag? by diskofish · · Score: 2, Informative

      PHP just makes it really easy to write sloppy code. I switched to doing primarily .NET few years back, and I prefer the more structured environment and compiled code. The only time I touch PHP now is to maintain existing code.

  18. Re:Major version? by WK2 · · Score: 2, Insightful

    They are removing some things. According to Splab, above, removing these things is a huge step forward. More importantly, removing things should always be a major release. They are breaking backwards compatibility with everything that uses the things that they are removing.

    --
    Write your own Choose Your Own Adventure. http://www.freegameengines.org/gamebook-engine/
  19. Re:Too Little Too Late by KnightMB · · Score: 5, Insightful

    Unfortunately, everyone has already realized that PHP is an insecure, featureless piece of crap. Real web developers have moved onto other platforms, or stuck with Perl. I think I hear this every time someone has been hurt by a buddy who was able to code circles around them in PHP while they struggled in Perl. Real web developers use every tool at their disposal, not just Perl or PHP only. Your statement alone shows the conceit you have about your own skills as compared to everyone else that makes a living doing web development, apparently much more successfully than you.
  20. New PHP features are great and all but.... by FilthCatcher · · Score: 5, Interesting

    My biggest issue with new PHP changes is fact that the sheer size of the PHP libraries mean that these new features don't bubble through to the whole core.

    For exmaple take the newish try / catch exception features. On first glance you think "finally I can write decent exception handling into my own code" - which is great for your own exceptions but too many of the core functions used by your code or by a framework you're using don't throw exceptions - they indicate an error codition in the function's result.

    So now we're seeing loads of code out there by people trying to do things "The right way (tm)" but it's full of bugs as there's exception conditions being raised by core functions that don't get caught by the catch blocks.

    The line from TFA that concerns me is "Much improved for PHP V6 is support for Unicode strings in many of the core functions"

    Many? That will means developers will start using unicode only to find scattered lines of code throughout the app doesn't work as the core function it uses doesn't support unicode. The overhead of keeping track of which functions do and don't support unicode will be a nightmare.

  21. Re:Is this really news? by NamShubCMX · · Score: 2, Informative

    Unicode support is reported to become available for 5.3+ later as a module.

    What I've heard the developers say, basically, is that there is no real roadmap for 6.0, since 5.3 has most of the planned features and unicode (the big new thing) will be available sometimes, although not built-in.

    --
    We've always been at war with Eurasia.
  22. Re:Too Little Too Late by njcoder · · Score: 2, Insightful

    Absolutely. It's not like anyone still uses PHP. Yeah. What happened in 2005 to make it plateau like that?
  23. Re:Is this really news? by dgatwood · · Score: 4, Informative

    What makes PHP nice is that, language-wise, it is basically C plus a subset of C++ wrapped up in a scripting language. Almost any code written in C (or C++ without templates/exceptions/other icky stuff) can be trivially ported to PHP by replacing the type names with "var" and adding dollar signs in the right places. (I'm exaggerating slightly, but not much.)

    PHP doesn't have any weird syntax like Perl regular expressions---you can do Perl regex, but it is neatly encapsultated into proper strings the way it should be. There's no having to manually re-indent dozens of lines of code because you needed to add another nesting level and whitespace is part of the language, etc. It's just a really clean, lightweight OO language that's exceptionally easy to learn and happens to integrate very well with HTML.

    Don't get me wrong, PHP has plenty of weak points when it comes to performance (particularly when dealing with massive complex data structures), availability of modules to do various obscure things, etc., but as a language, it is pretty nice, IMHO---mainly because it isn't a kitchen sink like Perl.... :-)

    --

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

  24. Re:Is this really news? by pembo13 · · Score: 2, Insightful

    That's pretty unfair circumstances under which to judge any language.

    --
    "Thanks for all the money you paid to us. We've used it to buy off ISO among other things" -Microsoft
  25. Re:Is this really news? by moderatorrater · · Score: 4, Insightful

    and happens to integrate very well with HTML Yes, like regular expressions happen to be good at finding string patterns. PHP is good because it is first, foremost, and almost exclusively a web scripting language, which means you get really like features like super globals, HTML embedding, loose typing, great escaping functions, etc. Most other languages try to be all things to all people, but PHP has a focus and it does it pretty well.
  26. Re:Is this really news? by chromatic · · Score: 4, Funny

    PHP doesn't have any weird syntax... It's just a really clean, lightweight OO language.... as a language, it ... isn't a kitchen sink like Perl.

    Did you have to shower after writing this? Did you at least burn the keyboard?

  27. Re:actually not by CastrTroy · · Score: 2, Informative

    Try doing a search on Dice.com, where they post jobs. ASP.Net Developer returns 3626, while PHP developer only returns 1514 jobs. That's less than half. So while PHP may be used by tons of hobbyist coders (I use it myself), ASP.Net is used much more in the business world.

    --

    Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
  28. Re:Is this really news? by mini+me · · Score: 3, Insightful

    What makes PHP nice is that, language-wise, it is basically C plus a subset of C++ wrapped up in a scripting language.

    That's the problem with PHP. It requires all the hard work of writing C-like code, without any of the benefits that one might chose C for.
  29. Re:Is this really news? by larry+bagina · · Score: 2, Insightful

    PHP doesn't have any weird syntax like Perl regular expressions---you can do Perl regex, but it is neatly encapsultated into proper strings the way it should be.

    Interesting example of PHP superiority. Perl regular expressions are delimited with / (or another character) because it's part of the language syntax. But if your regular expression is encapsulated in a string, there's no longer a need for it (which would simplify things since you don't need to escape it). Yet the pcre functions use a delimiter. Monkey see, monkey do. Without knowing why.

    --
    Do you even lift?

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

  30. Re:Is this really news? by natrius · · Score: 2, Informative

    There's no having to manually re-indent dozens of lines of code because you needed to add another nesting level and whitespace is part of the language, etc.

    First of all, if you don't re-indent your after adding another nesting level, you are making your code hard to read, and if I have to work on it after you, I will hate you for it. This is one of the reasons that Python is so pleasant. It forces people to write decent code.

    Secondly, if you're manually indenting each line of code, you should start using a modern text editor.

  31. Almost.. by encoderer · · Score: 2, Insightful

    ...He took the "contract." Nobody was forced.

    But his post is inane.

    Isn't it about as basic as it gets that code (outside of Java) should be developed on the same platform that it will ultimately be deployed upon?

    If he had done that, all he'd have needed to do was get a copy of the binary as compiled for use on the production server, and their php.ini. Install, copy in the php.ini, and he's up and running in an environment identical to the Prod server.

    Barring that, if he'd had gotten their php.ini anyone w/ any PHP experience would be able to see what non-std components were included, and the version everything is running at. Download it, compile it, install, and copy-in the php.ini.

    If he's spending a "good fraction" to get a "test bed" then he really should stick to tech support or network administration or whatever he's done over the past few years full time for a living.

    1. Re:Almost.. by cayenne8 · · Score: 2, Insightful
      "Isn't it about as basic as it gets that code (outside of Java) should be developed on the same platform that it will ultimately be deployed upon? "

      You're still in school or new to the real world, arent' you?

      :-)

      Of course it should be that way...but, often out there, you run into just this situation. The mgmt. wants a change or something done, but, they don't wanna buy new hardware, etc....

      It sucks, but, I've run into systems where the dev. and prod. are on different platforms...and this isnt' just because of cheapness, in the govt. contracts...sometimes one company wins the dev. part of the contract and a different company has the prod. I've seen this where the system is developed and tested in a win environment, but, is to be deployed to a unix environment, yet, they can't understand the inevitable problems that have to be ironed out, but, no time for this was scheduled. And this is on multi-million/billion dollar systems.

      This isn't something that is all that rare.

      --
      Light travels faster than sound. This is why some people appear bright until you hear them speak.........
    2. Re:Almost.. by njcoder · · Score: 2

      "Isn't it about as basic as it gets that code (outside of Java) should be developed on the same platform that it will ultimately be deployed upon? "

      You're still in school or new to the real world, arent' you?

      I do most of my Java web development on either win2k or winXP. (For other reasons I need certain windows apps).

      I use netbeans to develop and I generally deploy to RedHat, CentOS or Solaris using different servlet engines. Mainly Tomcat and Resin. I don't remember the last time I had problems deploying a WAR file from Windows to Linux or Solaris, other than what's in Context.xml, which is what that file is for. Sometimes people put things in web.xml that are related to the context and run into issues.

      Usually, if I have a problem it is when going from one servlet container to another or between versions of the same container. These are problems have been with stuff the stuff that's configured in the container such as JDBC DataPools, Environment Variables and other external resources.

      I've used all sorts of different libraries (jar files) that get included in the war file and haven't run into any issues.

      I've done some stuff in PHP and haven't been too impressed. One thing I really hate is that connections to mysql and postgresql require different code. In Java it's all JDBC. The few times I've had to switch between databases in Java the only changes necessary to the code were in the actual SQL if some advanced query options were necessary.

      There's just not enough consistency in PHP and you get some really odd method names that don't match up too well with similar functions in other libraries. I know some people have been critical over Sun for how much control they seem to want over the platform, but it has really helped developers in most cases. Having a well defined specification means and a verification of that specification before you can call your product java-something-compatible is nice.

      One thing I do like about php is that you don't have to wait as long as you do for a jsp to compile. When you're developing this can be a pain. Since Java5 this seems to have gotten better, Java6 improved it even more. PHP still has the edge here, but not as much as it did before especially with a decent processor. The JSP only needs to compile once though, after that there's really no noticable difference. In personal benchmarks I've done, I've had Tomcat put PHP to shame for code that was basically the same, except that the Java code was doing slightly more.

      I think PHP 4 was good for what it was. I remember a lot of past debates over Java vs PHP where people were trying to argue that you could do anything you can in Java in PHP except it is easier and faster. You couldn't. I'd be surprised if that was even true now. Although PHP does seem to be moving more towards features that Java has. OO, exceptions, namespaces, and more. To me that's a mistake. PHP was popular because it was easy. OO concepts and some of the other new features aren't that easy. In my opinion, PHP would have been better off sticking to what it started out as with better integration with Java, C maybe even .Net instead of trying to rewrite the features available in other languages. At the time PHP was gaining momentum, JSP wasn't that great. Because of PHP the JSP spec has made great strides to compete.

      Memory wise, if you're using mod_php, you'll probably use less memory between similar apps. In a shared environment though, using mod_php isn't very secure and the hacks to try and make it more secure are far from perfect. So if you're using fastcgi or something like that, so you can run a separate php engine per user, you will use more memory overall, and lose out on the performance of mod_php. Default Tomcat 6 on JDK6 takes up 30M of memory for me with no apps deployed and no tuning. Big apps like Drupal can have memory and performance issues. It all depends on how you code your app.

      I think people that a

  32. Re:Is this really news? by SanityInAnarchy · · Score: 2, Informative

    And yes, I'm manually indenting. I vi, therefore I am.... Vim can auto-indent. It shouldn't be too hard to find a command, or a script, to indent/unindent large chunks of text.

    I use Kate. Click & drag to select a large chunk of text, then tab/shift+tab to indent/unindent it. Trivial.
    --
    Don't thank God, thank a doctor!
  33. Re:Is this really news? by SanityInAnarchy · · Score: 3, Interesting

    More pointedly: If poorly-indented code is so troublesome that you'd "hate" the offending developer, you should start using a modern IDE. I prefer a modern editor to a modern IDE.

    I do want a certain amount of control over the structure of my code, even if a lot of it will be by convention. Having any automated tool try to "fix" someone else's code is likely to screw up things like comments which are cleverly indented and aligned with some code, or similarly interesting code.

    And an IDE is overkill in many other ways, yet they still often find ways to miss some functionality I want. That, and I tend to be much more easily able to switch text editors than switch IDEs.

    Disclaimer: I'm not GP, and I use Ruby.
    --
    Don't thank God, thank a doctor!
  34. Re:Is this really news? by chromatic · · Score: 3, Funny

    It's the only way to be sure.

  35. Re:Is this really news? by SanityInAnarchy · · Score: 4, Insightful

    PHP doesn't have any weird syntax like Perl regular expressions---you can do Perl regex, but it is neatly encapsultated into proper strings the way it should be. Regex is never really going to be readable without a separate course learning that. By the time you know regex syntax, a little extra syntax in your language isn't that bad.

    There's no having to manually re-indent dozens of lines of code because you needed to add another nesting level and whitespace is part of the language, etc. And there's no need to do so in any modern programming environment, either. Most text editors these days have ways to re-indent code, uncomment/comment keyboard shortcuts, etc.

    It's just a really clean, lightweight OO language that's exceptionally easy to learn Easy to learn if you already know HTML, I suppose. But where's my actual, interactive PHP shell that I can play with while I'm learning the language?

    OO? Only recently.

    Clean? Not even close, not when you've used a real OO language.

    and happens to integrate very well with HTML. So does everything else, now. I'd argue Ruby is actually better at this than PHP.

    Don't get me wrong, PHP has plenty of weak points when it comes to performance My language of choice right now is Ruby, so I don't really care about that.

    availability of modules to do various obscure things Considering the amount of crap built-in to the language, I doubt that's a huge stumbling block, either. I like CPAN, but it does help when the language itself is clean enough that I'll happily write a library of my own. But most that I'd need to do with a C library has bindings everywhere I really want to do it.

    mainly because it isn't a kitchen sink like Perl I think Perl has too many built-in functions, available everywhere, completely un-namespaced, compared to Ruby.

    But you know what? Perl has a little over two hundred functions in the main namespace. PHP has a little over three thousand, according to this page.

    So, it may not have the kitchen sink in the syntax, but it has the kitchen sink, the bathtub, the plumbing, and the neighbor's shower in the core library.

    Finally, I call BS on this:

    Almost any code written in C (or C++ without templates/exceptions/other icky stuff) can be trivially ported to PHP by replacing the type names with "var" and adding dollar signs in the right places. (I'm exaggerating slightly, but not much.) Is there a language, other than Python, that this isn't true of, for very simple, "Hello World" or "My first HMAC implementation" examples? Sure, the rules would be different, but dropping all the type declarations (swapping for "var") and adding dollar signs is significant.

    Oh, and does PHP support structs? What about function pointers? I doubt it's "almost any code". It's easy when you understand both C and PHP, but again, I assert that's true for many languages, particularly popular web scripting languages.
    --
    Don't thank God, thank a doctor!
  36. Re:Is this really news? by encoderer · · Score: 2

    Honestly, any IDE worth it's salt has by now solved the auto-formatter problem.

    It's a by-demand feature so it's not like Word AutoCorrect. And you should be able to use a nice WYSIWYG editor to build the rules.

    This is what you get, for example, in Eclipse and Visual Studio.

    Personally, I like things like integrated FTP, integrated subversion, integrated unit testing, and, most of all, an integrated server-side debugger w/ all expected function: breakpoint/play/step control, stack and heap manipulation, etc.

    All of these are possible using a text editor, but you need 5 different applications and none of it works together.

    Not to mention: INTELLISENSE and DATA TYPE DISCOVERY! (on a loosely typed language that's a big help).

    Instead of having to basically memorize or manually lookup class names, method names, and method arguments, I just begin typing the class name, use some arrow keys, and be done w/ it.

    Anybody using an IDE w/out these features is fine by me, but for good measure they really should bill a customer less than those of us do that are using these tools.

    You're deliberately handicapping your productivity. The customer shouldn't pay for that.

  37. Re:Is this really news? by kylehase · · Score: 2, Informative

    While I agree with your point let's not forget that it can be all things to all people. M0n0wall (and forks like PFsense and FreeNAS) uses PHP for shell scripting like startup and configuration scripts which I thought was pretty cool.

    --
    You want fun, go home and buy a monkey!
  38. Re:Is this really news? by RazzleDazzle · · Score: 2, Informative

    Something like *Tidy is all you need if you don't feel like using some fancy text editor or are too lazy to configure your editor.

    http://perltidy.sourceforge.net/
    http://rubyforge.org/projects/tidy
    http://tidy.sourceforge.net/
    etc

    --
    ZERO ZERO ONE ZERO ONE ZERO ONE ONE! Just brushing up for my next big invention: Ethernet over Voice (EoV)
  39. Re:Is this really news? by encoderer · · Score: 2, Interesting

    First, the PHP code doesn't really make sense. Why are you passing in the $args parameter?

    All this code is doing is accepting a method name, validating it as valid (yes, an Enum dt would help here), and returning it if it is.

    In which case, this is much better:

    if (is_callable($method)) {
        return method;
    }

    Or, more on point, you'd never even call the __call() method, you'd just call is_callable().

    I think the point is to show a plausible example of PHP being "hard work like C."

    I'm not a PHP apologist. It's got a lot of problems. Chief among them a glaring inconsistency that just makes an elegence-loving guy like myself cry my eyes out. But to say that it's "hard work like C" just because it retained a syntax and offers up some thin wrappers around C functions is, I believe, disingenuous.

  40. Clearly and expert consultant by NetCow · · Score: 2, Funny

    Well, at least the sample code has clearly been written by a PHP expert. For example, a newbie would write something like

    function is_authorized() {
    return isset($_SESSION['user']);
    }

    and get paid for just three measly lines of code.

    Thank $deity Nathan A. Good (mail@nathanagood.com), Senior Information Engineer, Consultant stepped in and corrected this to

    function is_authorized() {
    if (isset($_SESSION['user'])) {
    return true;
    } else {
    return false;
    }
    }

    Go, consultant-written code, go!

  41. Re:Is this really news? by moderatorrater · · Score: 4, Interesting

    Can you be more specific about how PHP "has a focus" on Web scripting PHP was made originally to program web pages and, while it's been expanded to other uses, its main focus is still web pages. $_GET, $_POST, $_SESSION, $_COOKIE, and $_REQUEST are (as far as I know) unique to PHP in being built into the core of the language. As frustrating as it sometimes is, PHP files are considered standard output unless they have tags enclosing them, whereas in perl everything is considered code unless stated otherwise.

    Loose typing and non-strict syntax in general is particularly well suited to the internet because each request generates a completely new environment. Something that was wrong with the previous request, unless specifically stored, doesn't affect the next request. Strictness in programming stems from the need to keep far flung parts from affecting each other; the web is modular by nature and thus resistant to wide spread bugs. Thus, loose typing and other, less strict forms of programming that make life easier at the expense of fragility is counterbalanced by the modular nature.

    Many won't agree with that analysis, and that's fine. Sloppy coding has gotten more than one web project in trouble, and more than one feature of PHP's that was intended to make life easier ended up going to far and introducing security holes. But that doesn't change the simple fact that PHP was made for the web and has conveniences built into the core that other languages either don't have or require an add on for.
  42. Why PHP does NOT suck by mcrbids · · Score: 3, Insightful

    I've worked with PHP professionally, building a healthy, heavily profitable, and rapidly growing company providing information management services to schools.

    From the simple standpoint of "concept to implementation" - PHP ROCKS. It's very, very fast, requiring little in the way of "planning" and "structuring" while letting the features come out... FAST. It is, bar none, the best RAD environment I've yet worked with. Not that it's the best in every area, but that it clearly has the best balance between features and "gotchas". It has its weaknesses, such as lousy error reporting, but even that can be largely mitigated with a little intelligence in advance. But it really does have a number of key strengths that I leverage to the hilt:

    1) Stability. It just doesn't die. Ever. I've never, ever, ever had a problem with PHP "not working". I don't troubleshoot it. It's there, it works, and I don't sweat it.

    2) Scalability. It's "share nothing" approach makes clusting and random-host selection boil all the way down to a simple session manager. Having 1 or 10 application servers running side-by-side is almost trivial!

    3) Code density = excellent! It's a fairly dense language, meaning that lots can get done in a few lines. Just for giggles, I've written a self-forking, multi-process daemon with a process manager and hundreds of managed children forks performing a deep-level network scan in like 50 lines!

    4) Security. Yes, you heard me correctly. Although you can certainly use PHP "wrong", you can also use it "right". Once you do, you discover that PHP has a number of features that make things like SQL injection and shell parameter expansion a thing of the past. Really. Learn your tools!

    5) Flexibility. You can run it as a module inside Apache. You can run it as a standalone executable. With tools like Ion Cube and PHP-GTK, you can create a cross-platform GUI application without revealing source.

    6) Availability. Any $5/month web hosting company supports PHP, and there are many free ones, as well. You can download a CD, install Linux, and have PHP/Apache up and running in under 10 minutes. There are batrillzions of apps available A LA SourceForge for free. PHP is the most commonly available web development language. And, by no means is it a web-only development language!

    Sorry you can't handle a few quirks in the function names. (so write out a file of wrapper functions - DUH!) Sorry that it's attempts to simplify variable management weren't perfect. Geez. Just code in c and be done with it, why don't you?

    In short, PHP is everything that VB and .NET wished to be, only cross-platform. It's an excellent tool for developing information-processing applications, very, very rapidly. Yes, it has its weaknesses, and nobody's forcing you to use it, and the devs are working on the weaknesses, too. Go use Ruby if it makes you feel good. But PHP works well on Windows, Mac, Linux, BSD, and many others. Seriously: you really can't go too wrong betting on PHP unless you need 3D graphics!

    --
    I have no problem with your religion until you decide it's reason to deprive others of the truth.
    1. Re:Why PHP does NOT suck by bigtrike · · Score: 2, Informative

      I've used PHP for about 7 years now and I've had the entirely opposite experience.

      1. Stability isn't that great. I've run into many glitches over the years and had my share of segmentation faults fixed. Ever run make test on a build? I've never once had PHP pass all of its own unit tests.

      2. PHP is so inefficient with memory that anything but the most simple application can take tens to hundreds of megabytes. This isn't a huge deal though, because gigs of ram are pretty cheap these days.

      3. PHP seems similar to most anything else, as a lot of the code space is taken up by comments. It seems to require more comments than most languages, as a lot of effort has to be taken to deal with quirks in automatic type conversion and the lack of a fixed point data type. (example: when the quoted string '1' is used as an array key, it's automatically converted numeric, but when the quoted string '1000000000' is used, its left as a string rather converted to a float).

      4. This is only true as of PHP 5, because prior to the introduction of PDO there was no portable way to use parameters in queries. PDO creates its own set of headaches however, because it does not properly support many data types such as bool in all supported databases.

      5. This flexibility has a lot of quirks. Certain functions behave differently on different platforms (strtothime handles dates prior to 1970 return different results on a redhat system than they do on a debian system due to different LIBC patch sets, although this may have been fixed in 5.2), some functions are only available.

      6. My experience with cheap web hosts is limited so I can't comment here.

      As far as the suggestion to simply use another language, it's unfortunately not an option.

  43. Re:Is this really news? by SanityInAnarchy · · Score: 2, Insightful

    Personally, I like things like integrated FTP, integrated subversion, integrated unit testing, and, most of all, an integrated server-side debugger w/ all expected function: breakpoint/play/step control, stack and heap manipulation, etc.

    The debugger is the only thing I miss from a "real" IDE.

    Subversion is garbage, of the "at least it's not CVS" variety. There are at least some ten or twenty distributed version control systems out there, at least one of which has got to work well for you.

    FTP is garbage. Use anything else. Yes, anything else.

    These are actually related. I don't really like most of the stuff you mentioned "integrated", as that usually means things like "I have a keyboard shortcut to run unit tests!" Great, but I'm comfortable on the commandline. Let me switch between my editor and terminal easily, and I'll run unit tests, run a development server, and anything else I feel like.

    The other reason is that I can then switch to pretty much anything else without having to switch IDEs. I know just about everything is supported on Eclipse, but "just about" isn't everything. I don't have to choose between Git and Subversion -- I can use bzr, hg, darcs, or really whatever the fsck I want. I don't have to use FTP because it's got the prettiest interface -- I'm just as comfortable with scp -- or, when it makes sense, Capistrano -- I can even use things like KDE's fish GUI for ssh.

    All of these are possible using a text editor, but you need 5 different applications

    Yes, that's the Unix Way.

    and none of it works together.

    Wrong, wrong, WRONG!

    All of it works very well together. On the occasions where it doesn't, I can hack together the glue require reasonably quickly, and be back to being as productive as I was before -- but these cases are also times when an IDE wouldn't be able to work with them at all, and I know a lot more about hacking together scripts (shell and similar) than I do about writing Eclipse plugins.

    Not to mention: INTELLISENSE

    Useless, unless it's linked to documentation. And then, still useless, compared to flipping over to my browser and asking Google, since I probably don't actually know what I want there.

    Not that I would be against having it, but I'm not willing to fire up Eclipse (and burn all my RAM, and still have it be sloppy and inaccurate due to being a dynamic language) just for Intellisense.

    And then there's workspace management, and keeping plugins in sync, and dealing with when plugins go bad -- can't start Eclipse until I figure out which plugin is making it crash, or, more likely, wipe it and reinstall from scratch -- and it'll autodetect the file as the wrong type, so now I have to go fuck with its filetype associations, and set keyboard shortcuts -- whoops, the shortcuts I want aren't there...

    There's a whole new level of bullshit I'd have to deal with if I was using an IDE. I know, I was for awhile.

    and DATA TYPE DISCOVERY! (on a loosely typed language that's a big help).

    If I understand this, it might be a help if I had functions so massive I can actually lose track of a variable, or if you're talking about the whole built-in debugger feature.

    Instead of having to basically memorize or manually lookup class names, method names, and method arguments, I just begin typing the class name, use some arrow keys, and be done w/ it.

    Except that by the time I'm doing that, I probably want to know more about it. For example: Is this indexed from zero, or one? How do I create a has_many relationship with an order clause? Does that have to be a string, or can it also be some other cool data structure?

    Let me know if you find an IDE that can handle Intellisense in Ruby and actually make me more productive.

    Oh, also, a fair amount of what you're doing probably should fit in your head. If you're not doing PHP and needing to know things like mysql_real_

    --
    Don't thank God, thank a doctor!
  44. Re:Is this really news? by Wiseman1024 · · Score: 2, Interesting

    Better Unicode support, which is a major, desirable feature, as others pointed out, and as far as I know, magic_quotes won't be deprecated in 5.3. Just deprecating magic_quotes, the last piece of shit to get rid of (the other two were register_globals and safe_mode) justifies a new major version giving PHP a refreshed image. They finally got rid of three of the worst features ever thought in a programming language other than COBOL, FORTRAN, BASIC, RPG and similar crap.

    Now they need to get rid of the fatal error on function redefinition or function not found stupidity (that was REALLY retarded, probably the single worst feature after the three I mentioned), lexical scoping, syntax for lambda-expressions, first-class functions, better garbage collection, true object-orientation, a decent class system (i.e. one that's not modelled after Java's), operator overloading, associative arrays with support for non-string keys, decent iterators which don't require you to define 235789051 methods - just one (next) as a minimum, generators, coroutines, threads, a decent eval without the return insanity, and functional programming tools. Oh, wait, they need Python!

    On top of that, I'd get rid of statements (make all of them expressions), add guaranteed tail-call elimination and get rid of the dollar sign.

    --
    I was about to say 13256278887989457651018865901401704640, but it appears this number is private property.
  45. safe mode hurray! by remmelt · · Score: 2, Informative

    Each time I read that they're ditching safe_mode, I do a little happy dance and shed a tear of delight.

    All the other stuff is great as well, but safemode has made the quality of my life significantly worse in the past.

  46. Re:Is this really news? by Dogtanian · · Score: 3, Insightful

    it's not like writing your own string library is any monumental task. Your string library still looks somewhat clumsy, particularly for small projects. And I note that your functions only concatenate two strings; what if you want to stick a few together at once? (Yes, you could use var-args, but what's the checking like on that)

    What if you want to append a number to a string? Given that standard C doesn't support overloading, would you have to write a new *differently-named* method? It'd be a nuisance to have to keep track of all the different methods when (e.g.) PHP can simply do the whole lot using the '+' operator.

    it's a scripting language, it makes no sense to resemble C in any respect. Wrong; it makes perfect sense to use C-style syntax. That's almost certainly the most common syntax by far, used as it is in C++, Java, JavaScript, C# and many other languages.

    Visual Basic's syntax is different, and I had to learn this all over again when I used it for the first time, because I'm used to C-influenced languages. The mental context switch required and my tendency to keep inadvertantly using C-style syntax (leading to syntax errors) is a PITA.

    I wouldn't mind if the VB syntax was nice to begin with, but it's not. It's inelegant and clunky; probably not bad considering it was derived from BASIC, but still inelegant and clunky. It probably got that way because it mutated from BASICs MS-DOS/PC programmers were familiar with, carrying them along with it. However, if (like me) you're not already used to that flavour of BASIC and haven't even used BASIC for years, it's not easy to use at all. It's not even that much like the old BASICs I used to use. Though this is getting away from the main point...

    There may be valid reasons for using a different syntax, but those should reflect underlying differences in the structure/approach of the language (even Perl syntax is somewhat C-flavoured in various respects). However, using a fundamentally different syntax just for the sake of it is a Bad Idea. PHP is easier to use because it has a C-derived syntax.
    --
    "Slashdot - News and Chat Sites Deviant". (Click "homepage" link above for details).
  47. Re:Is this really news? by Hognoxious · · Score: 2, Funny

    I really despise this kind of post, where each sentence is torn apart and commented on separately;
    That would be a lot easier if you actually wrote proper sentences.

    usually with a sarcastic and snotty tone to it.
    See what I mean?

    In my opinion,
    Which we all totally care about.

    it's just high brow trolling
    I find it quite amusing.

    and makes the poster look like a right dick.
    I know you are but what am I?
    --
    Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  48. Re:Stop calling it PHP by Tetsujin · · Score: 2, Insightful

    This attitude - that new versions of the language should always support everything the old versions supported - only makes sense if you assume that the initial design was perfectly sound to begin with.

    Had PHP4 been perfectly designed, and perfectly well-suited to what people are now using PHP for, there wouldn't be any need to change it at all. But PHP isn't perfect. They've found ways to make it better. They could fork off a new project containing those changes - but PHP6 is more like PHP5 than not - and if they had to fork off every time they changed things around they'd have a lot of extraneous extra names for basically the same thing.

    Also consider - how much time and effort might they have to put in to augmenting PHP6 to be fully backward-compatible, and to maintain that awkwardness - even in the face of new features that may flat-out contradict older policies in the language? How much work would have to be wasted just to make PHP6 a better PHP4 than PHP4 is?

    If you wrote your code for PHP4, just keep running it on PHP4 until you're ready to port it.

    --
    Bow-ties are cool.
  49. Re:Major version? by Haeleth · · Score: 2, Interesting

    There was actually a lot of resistance to Unicode in Japan: there were some unfortunate misunderstandings early on that led a lot of Japanese people to believe that Unicode was trying to force them to use Chinese conventions for character shapes. It also doesn't help that all the various UTFs appear to be less efficient at encoding Japanese than their various legacy encoding systems. (Of course, neither of these things is really an issue in practice, but we're talking about popular perception here!)

    I don't know if Matz was among those who held those incorrect beliefs, but even if he wasn't, there still won't have been any compelling reason for him to adopt Unicode. Multilingual character sets are only a big win if you're mixing multiple languages. If Matz didn't originally expect Ruby to take off in a big way internationally, then for the sorts of uses he probably envisaged, just Japanese and English would be fine, and you can handle that combination perfectly well using any of the legacy Japanese systems.