Slashdot Mirror


PHP 5.1.0 Released

kv9 writes "A new release of PHP5 is available. This version includes over 400 bugfixes, performance improvements over the 5.0.x branch, new date handling code, new versions of PCRE/SQLite/PEAR and over 30 new core/extension functions. A number of security fixes are also present and users are recommended to upgrade."

24 of 275 comments (clear)

  1. mySQL support by Anonymous Coward · · Score: 5, Funny

    MySQL support has been droped in favor of using simple flat text files. The performance increase from this has been HUGE and the feature set is the same.

    1. Re:mySQL support by CyricZ · · Score: 4, Insightful

      A lot of people who criticize MySQL have directly used MySQL. What we've found is that for lighter tasks (such as many webpages), SQLite often works quite well. And once/if you need a database system that's more capable, it's best just to move to PostgreSQL.

      The recent Oracle/InnoDB and MySQL AB/SCO debacles have also made many potential MySQL users weary. There are many users who are now questioning how viable MySQL will be in the near future, both from a technical standpoint with regards to the InnoDB purchase by Oracle, and from a legal standpoint concerning their dealings with SCO. SQLite and PostgreSQL do not suffer from such unknowns.

      --
      Cyric Zndovzny at your service.
    2. Re:mySQL support by kpharmer · · Score: 3, Interesting

      > For read-only, or even read-mostly, MySQL is blisteringly fast.

      I think you mean that when doing lookups of a very small (less than 1%) set of data from a single table with simple queries that mysql understands the b-tree index in myisam or oracle's innodb is as fast as any other database. In the case of myisam maybe a little more, in the case of innodb maybe a little less.

      I'm sure you don't mean that when selecting 10% of the data of a single table of the database (thereby unable to do b-tree lookups) and doing table scans instead that it is very fast at all. It might be competitive with postgresql, firebird, and sqllite there, but falls *completely* behind oracle, db2, informix, sqlbase, and now sql server when using partitioning. Or parallelism.

      And you probably didn't mean that it was fast when handling complex queries. It's notoriously bad about handling them.

      > On Linux, with a disk caching policy of "Never, ever commit anything unless you have to swap something
      > from RAM, or are about to umount the file system" and enough RAM to cache the whole table file, MySQL writes
      > almost as fast as it reads. OSes with more conservative policies, such as insisting to decache often and
      > verifying before releasing the RAM, obviously won't be so fast {but who'll be laughing at who when the power
      > comes back on?}.

      Wouldn't this be better resolved through a storage adapter with 128 mbytes or more of battery-backed disk cache, and then turning on write-caching - and having your storage system handle it? In this scenario you are very unlikely to corrupt or lose data due to a power outage or crash.

      And you had mentioned large files - what if you've got a 10 gbyte file? Doing lots of concurrent writing to it? This won't fit into memory, so now you're back to the writing-at-the-speed-of-a-snail speed.

      > What is it with the MySQL bashers around here?

      - too much hype
      - company leadership that covered up missing *basic* features in the product for years insisting people don't need them anyway
      - unsubstantiated claims (blisteringly fast) that end up being gross exaggerations at best
      - most non-ansi implementation in the marketplace
      - deliberately complex dual-licensing scheme that doesn't comply with GPL
      - inability to handle even moderately complex queries
      - absolutely bizarre exception handling issues (silent truncations, etc)

      MySQL is a success story, but mostly a marketing success story. It started as a sql layer on top of flat files - not intended to be a database management system - just a file management system. And then people applied this tool to database management - without even the most basic of features (views, transactions, etc).

      This isn't to say that people can't successfully use it for database management. Of course you can. You can also pull stumps with a ford explorer. It's just that the explorer wasn't really designed for pulling stumps, and a tractor does it *so* much better.

    3. Re:mySQL support by Bake · · Score: 3, Informative

      Can you just do an SQL dump from MySQL and put it into Postgre, no problems?

      Actually, this can be tricky due to MySQL's tendencies to massage data to fit comfortably into tables. Using defaults such as 0000-00-00 in date fields instead of NULL, allowing values such as 2005-02-30 (i.e. 30th of February).

      If you have such values in your MySQL database and intend to migrate that data into PostgreSQL, you first have to make the data conform to the C part of ACID (Consistency) before moving it to other RDBMS systems.

  2. Sendmail by jrockway · · Score: 3, Funny

    > A number of security fixes are also present

    I think we've finally found a replacement for the security disaster known as sendmail -- PHP.

    --
    My other car is first.
  3. Many improvement... by masklinn · · Score: 3, Funny

    ...and still no damn fucking namespaces.

    Go PHP, ride on to the 20th century!

    --
    "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
    1. Re:Many improvement... by Anonymous Coward · · Score: 3, Informative

      They are considering namespaces for PHP 6 - Read the meeting notes here:

      http://www.php.net/~derick/meeting-notes.html

      http://www.corephp.co.uk/archives/19-Prepare-for-P HP-6.html

    2. Re:Many improvement... by g2devi · · Score: 4, Interesting

      Relating to this comment:
      http://developers.slashdot.org/comments.pl?sid=169 325&cid=14113043

      It's true that PHP suffers from various naming conventions, but namespaces might me the answer.

      For PHP 6.0, does anyone know if the core developers are thinking of moving most builtin libraries into namespaces? For instance:
      . . . http://ca.php.net/manual/en/function.oci-commit.ph p
      could be placed in the "builtin\oci" namespace and
      . . . http://ca.php.net/manual/en/function.ocicommit.php
      could be placed in the "builtin\legacy\oci" namespace.

      You could quickly convert all PHP5 to PHP6 simply by adding the line:
      . . . import builtin\*;
      to the top of every file to make all builtin functions global (the way they are in PHP5).

      Apps written in PHP5 would still work without the import, but they'd get a warning (which could be switches off in the php.ini).

  4. Re:All of my friends and family use the new PHP by masklinn · · Score: 4, Insightful

    Rails still isn't a language, it's a framework.

    (calling Ruby a "toy language" when comparing it to PHP is hillarous though, thanks for the laugh)

    --
    "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
  5. Beware of PHP 5.1 by Anonymous Coward · · Score: 5, Informative

    You don't have any classes named Date, do you? It's an extremely uncommon name. Good thing we have namespaces.

    http://news.php.net/php.internals/20352

    1. Re:Beware of PHP 5.1 by Tim+Browse · · Score: 3, Funny

      I've only messed around with PHP for my personal website and a small catalogue style website for my parents' business, but I noticed there were no namespaces, so I simulated them by prefixing class/function names with short prefixes, e.g. twbb_GetForumThread() etc.

      I don't envisage having any problems with the new PHP core functions colliding with my names. But then maybe that's because I've worked with other languages that don't have namespaces (e.g. C, which I believe had some brief border-line success/popularity at one point, despite being crippled by lack of namespaces), and also I have a fucking clue what I'm doing. Idiots, on the other hand, will always run into problems.

      That's not to say I wouldn't like to see namespaces in PHP :-)

  6. Bug fixes should go into 5.0.x by halfnerd · · Score: 5, Insightful

    I was under the impression that when using a x.y.z -versioning scheme, bug fixes should be released with increments of z, new features with increments of y, unless they break compatibility, when x should be increased. But when has even PHP done some something in a standard way.

  7. Adding even more functions? by A+beautiful+mind · · Score: 5, Insightful

    "(...)and over 30 new core/extension functions."

    Ugh. Adding still to the inconsistent, namespace mess, PHP functions have? Worst. Decision. Ever.

    --
    It takes a man to suffer ignorance and smile
    Be yourself no matter what they say
  8. Advances/Alternative to the server by Kunta+Kinte · · Score: 4, Interesting
    PHP's big problem is not language features anymore. It's the lack of innovation in the PHP server program.

    Zend refuses to add basic features such as a basic accelerator ( PHP scripts get recompiled on every request ). In fact, there was a rumor that Zend bought and killed http://sourceforge.net/projects/turck-mmcache/, the best accelerator out there because it competed with their commercial product.

    I understand that money has to be made for development to continue, but that's no way to compete.

    PHP server needs true session and application scope variables. File-based session variables it has right now means that any variable that's not serializable ( eg. file descriptor ) can not be saved in the session scope. This is a huge problem. It results in developers making countless round trips to their database to serialize data, and hence making PHP scripts more dependant on close/performant database in general. There was an mmap based solution being worked on, but haven't heard much about it lately.

    Other web environments have had these features for years.

    I'm guessing that that sought of restriction on the PHP server will continue until an alternative server is developed and begins to gain popularity.

    --
    Based on upvotes, Ageism is the only "-ism" Slashdotters care about and think isn't SJW
  9. OO by smallguy78 · · Score: 4, Informative

    I use to use PHP a lot day to day for several years (lamp), and found it kicked the ass of ASP for doing really fast web apps. Bigger web applications however, is where its mechanics started to erode - specically includes and the old module level variables issue.

    PHP 5 brought more OO features but it's still loosely typed and not compiled, meaning its OO features pale in comparison to JSP and ASP.NET. Until these two features are added by default (yes I know there are compilers), I can't really see how people will want to make use of its OO features in a business scenario. It handles strings (atleast in 4) about 50x slower than .net and seems to be stuck between a scripting language and a fully fledged OO language.

    --
    Nothing costs nothing
    1. Re:OO by moro_666 · · Score: 3, Insightful

      you forgot to add that real programming languages are pretty much backward compatible, whereas php's backward compatibility doesn't just suck, it's nearly non-existant. references, oop parent class calls, global variables etc. this language gets ever more messed up with every new version and with zillion little configuration flags that affect the very basic functions and breaks down even the most patient code.

      php has it's good sides but it the long run it's definitely the loser platform from my point of view. even perl is more stable and readable after 3 years of support on the same code (on php you either do very expensive upgrades to the software every time there are some major changes or you do cheap fixes and the code turns into a mess).

      have you ever tried to read a well organized OOP php source that is supposed to work with every version from 4.0 to 5.x ? nope ? give it a try, i'm sure you will fall off the fgging chair.

      i suggest you use something else, use python, use ruby, if you need to kiss your bosses ass you might even use java but keep your fingers away from php while you can.

      --

      I'd tell you the chances of this story being a dupe, but you wouldn't like it.
  10. Did you look at the PHP 6.0 codebase ? by Gopal.V · · Score: 3, Interesting
    Sometime back, I pulled out the CVS HEAD and tried to hack on top of it. Needless to say it looked alien, with all the hash tables walking around with unicode all around. Php 5.1.xx is only a small step, 6.0 is going to really come crashing down.

    I'd like to take this oppurtunity to complain about __autoload in PHP5. It is one functionality which I find tremendously inconvenient when coding something like APC . File inclusions were never supposed to be that dynamic, it ends up with different compilations of the same file for different places it is included in (apparently some are still fighting).

  11. Re:Great, now what about hosting companies by CyricZ · · Score: 4, Insightful

    If you want cutting edge, then you'll most likely need to run your own server.

    Serious hosting companies just can't risk running software that hasn't been widely tested. While there may be benefits from running the new versions of PHP, for instance, it could be a disaster if a security flaw leads to their servers being compromised. An incident like that could financially destroy a small- or medium-sized hosting company. At least the older versions of PHP have undergone more testing than the newer releases.

    --
    Cyric Zndovzny at your service.
  12. PHP Security by shiflett · · Score: 3, Interesting

    Some of us are trying to help the situation by educating PHP developers. For my part, I try to write articles (and make them available for free), give talks at conferences and user groups, and answer questions on mailing lists and forums.

    There's also the PHP Security Consortium, the Zend Framework (which will hopefully include most things on my wishlist as well as solve other problems), and a new input filter extension.

    As BP says, it's a start.

  13. Some more alternatives to MySQL by Elrac · · Score: 4, Interesting
    I apologize for being a bit off topic, but I'd like to throw in a couple of cents' worth on newly emerged alternatives in the "free DB" arena. Hopefully PHP support for these will be forthcoming forthwith:
    • IBM has spiffed up Cloudscape to be somewhat compatible to DB2, renamed it to Derby and is giving it away
    • Oracle is giving away a mildly crippled version of its DB, I don't remember the exact circumstances
    • ADABAS, also known as SAP DB, is now also FOSS
    • Firebird, née Interbase, was freed years ago and is said to be working well and under active development. I don't know why so few people seem to like it.
    • I believe I heard about SQL Server being "free" under some circumstances too, but I'm not sure.
    So... many thanks to MySQL for being a forerunner in the "free DB" department, and more thanks to other, formerly proprietary-only vendors for making their products a little more accessible to the common man!
    --
    When one person suffers from a delusion, it is called insanity. When many people suffer from a delusion it is called Rel
  14. Re:Backgrounds of the PHP developers. by Elrac · · Score: 5, Insightful
    The Zend guys happen to be damn good programmers - have a look at the code of the interpreter
    That sentence illustrates the problem and your lack of understanding of it.

    Design and programming are two distinct disciplines. Some brilliant developers are good at both, but many people, myself included, get too much satisfaction from diving into coding to thoroughly think about what they are embarking on. The result is a program/system/language/whatever that starts with a clean small core but grows ever bigger and uglier as changes are bolted on. I tried PHP a couple years back and was disgusted by it. There's a reason why computer language design is a discipline of an academic subject, Computer Science: A wealth of knowledge has accumulated on how to do this kind of thing "right," and applying that knowledge will usually lead to a better end result.

    Specifically, my beef with PHP summarizes down to: It makes simple things simple in a way that encourages sloppy coding. PHP is to the current would-be Web geek generation what BASIC was to teenage would-be hotshot coders in the late '80s: A way to achieve "gee whiz!" effects easily and cheaply. It's possible to write large, elegant programs in PHP, but that's not what usually happens.
    --
    When one person suffers from a delusion, it is called insanity. When many people suffer from a delusion it is called Rel
  15. I here lot's of bickering about PHP 5 ... by Qbertino · · Score: 4, Insightful

    ... still having no namespaces and lacking in full-blown OOP and all.

    So what?

    PHP is the web generations basic. No more. But no less either.

    Given that loads of very usefull webapps out there are built in PHP
    I'd say the criticisim is mostly inadequate whining. If PHP doesn't
    cut it for your job, take something else. No big deal.

    --
    We suffer more in our imagination than in reality. - Seneca
  16. Re:Backgrounds of the PHP developers. by dragonman97 · · Score: 3, Informative

    Unlike some of the other replies, I agree wholeheartedly. I am a Perl programmer, who actually has a clue about programming. (And I write legible Perl, thank you very much. [most of the time ;)])

    I've just 'inherited' a PHP project, and I want to scream. I've finally had to 'learn my enemy.' So, wanting to know what the heck I was getting into, I bought a ton of O'Reilly books, and I read through a bunch of "Programming PHP" before beginning, so I wouldn't make the mistake of just slapping together whatever worked. Getting right into it, I was appalled at how poor the 'design' of the language is. It's a poor ripoff of many decent languages, slapped together in whatever Q&D way would 'make it work.' Why are phonetic string comparison functions part of the core language?! Those should be in a library! Why, oh why, was the scoping done so utterly backwards?! I was cleaning up some code, moving it into a function, and suddenly it stopped working. I had realized the answer the first time I tweaked it, but summarily forgot the second time around. What was it? Why, naturally, I had forgotten to do 'global $foo' inside my function - how stupid could I be to think code inside a function wouldn't pick up the contents of the variable as declared outside it?

    *sigh* I've gotten a project with 15,600 lines of 'code,' and already gotten rid of 1200 lines of repetitive junk by applying some common sense to it. I have another 120 lines lined up to be shot today. (A diff -uw of 2 files turned up exactly 5 differences.)

    PHP makes it way to easy for people without a clue to 'write code' that 'works.' Thank you all the same, but I prefer to keep my brain engaged in 'drive,' rather than 'park.'

  17. Re:Backgrounds of the PHP developers. by killjoe · · Score: 3, Insightful

    Personally I think the use of the "global" keyword is something PHP got right and every other language (except ruby) got wrong. When you are reading a function it's good to know where all the variables are coming from. In ruby they use a sigil, in PHP they use a keyword, in every other language you have to search through the function to see where and if the variable was declared and deduce that it was either a global variable or a typo.

    To recap. PHP got it right, perl got it wrong. You are annoyed because it's not the way you are used to working but that has nothing to do with the merits of the scoping rules.

    --
    evil is as evil does