Slashdot Mirror


PHP 5 Beta 1

Sterling Hughes writes "The PHP development community is proud to announce the release of PHP 5 Beta 1. Downloads are available in both source and binary form (for Windows users). A full list of changes is available in the ChangeLog. Some of the new features include much improved OO support, completely revamped XML support, and the default inclusion of SQLite."

22 of 398 comments (clear)

  1. Problems with newer versions by Sanity · · Score: 4, Insightful
    I recently developed a number of sites in PHP and ran into serious problems when it became clear that most hosting providers use older versions of PHP, and are scared to death to upgrade lest they screw things up for their existing users.

    The PHP people need to provide ways that people can upgrade the versions of PHP on their system such that they can be reasonably sure that existing users aren't suddenly going to find their sites don't work.

    1. Re:Problems with newer versions by CausticWindow · · Score: 2, Insightful

      There's no problem running different versions of php on the same webserver. We're running php 3 and php 4 here, without any problems.

      --
      How small a thought it takes to fill a whole life
    2. Re:Problems with newer versions by Sanity · · Score: 4, Insightful
      If you're doing a non-trivial php site, and trying to make it work with different versions of php (osCommerce, for example), you end up having to rewrite many functions yourself to make sure they work consistently.
      Absolutely, this is exactly the experience I had.
      I like PHP, but it suffers from an "incrementalism" design approach. Some stuff really needs to be rethought, and I think PHP 5 is on the right track to doing that.
      I hope you are right, but right now I am more concerned about how to deal with differences between different PHP4 versions - it is immensely frustrating to inadvertantly use a function only to discover that it doesn't exist on your new ISPs version of PHP (and of-course they won't upgrade for love nor money lest they upset their other users).

      Someone involved in PHP needs to take a cold hard look at this issue and figure out how to tackle it head-on, or they will find that with each new version, people take longer and longer to take advantage of new features which will cause PHP to stagnate.

      With Java, at least I know for a fact that some Java 1.1 code will work with Java 1.4 and as a result most ISPs keep their Java versions quite up-to-date.

      Until the PHP team treat lack of backward compatability as a bug, this problem will persist.

    3. Re:Problems with newer versions by steveg · · Score: 2, Insightful

      If you are trying to match the options from a previous install, what I do is create a page with phpinfo() on it. This displays the entire configuration, including the compile configuration. I just cut and paste that section of the output page onto the command line and I get a build of the new version with the same options.

      Doesn't help if they've changed how an option is invoked at ./configure time, but other than that it does the job.

      Runtime behavior changes are a different matter.

      --
      Ignorance killed the cat. Curiosity was framed.
  2. Re:They pulled MySQL out! by baptiste · · Score: 4, Insightful

    Ah - well man they need to be clearer about it - the phrase makes it sound like they pulled out MySQL support. The Changelog mentions the library - but even it is really brief. I always thought PHP used your local libraries anyway - I didn't realize it came with them in 4.x

  3. Destructors! Hooray! by Wuhao · · Score: 2, Insightful

    I have always been very annoyed not having destructors in PHP. PHP5 includes destructors, along with public/private class members. I can't wait for this to be released as a stable version.

  4. But how? by yerricde · · Score: 3, Insightful

    what's so difficult about using your own mysql installation?

    How do I tell binary PHP to use the installed binary MySQL?

    Please read this comment before replying with such an answer along the lines of "compile it yourself".

    --
    Will I retire or break 10K?
  5. Re:Requires Microsoft Visual C++ by yerricde · · Score: 1, Insightful

    Does Linux support all the hardware in a typical Dell desktop machine that my parents bought before I learned about Linux?

    "So don't buy Windows-specific hardware." Why can't I find penguin logos on any of the boxes of PCI, AGP, and USB devices that I see at Best Buy or Circuit City? Where should I be shopping instead?

    Does Wine run all my legacy Windows applications for which there exists no stable Free replacement?

    Will Comcast troubleshoot the Internet connection to my machine if I'm running something other than Windows on an x86 box?

    --
    Will I retire or break 10K?
  6. Re:Windows Users by hhnerkopfabbeisser · · Score: 4, Insightful

    The sources can be compiled under Windows and most Unices.

    But since Windows doesn't come with a compiler, there is a binary provided for Windows.

    So what's your point?

  7. Re: Just use ODBC by Billly+Gates · · Score: 2, Insightful
    For those using a Unix or Unixlike system there is also UnixODBC.

    Problem solved.

    Its better software engineering wise to use layer with ODBC or something similiar to access your database. Changes to your database will not require whole rewrites. Also you can host the database on a different server other then your web one.

    I consider myself an amuture database programmer so feel free to correct me if I am wrong regarding something like ODBC to connect to a remote server. I think Oracle has some proprietary redirector/protocal similiar to ODBC but I have never used it and can not comment.

    Anyway its not a problem and its good on your resume to learn general sql commands and switch between Sybase, postgreSQL, and MYsql rather then hardcode to a specific database.

    I also recommend Interbase if your looking for a great way to learn ANSI sql via odbc. Its free from Borland. PostgreSQL looks cool but it has mediocre WIndows support via cygwin.

  8. Re:Kiss and say goodbye to Java language!! by alannon · · Score: 5, Insightful
    PHP is a very lightening fast object oriented scripting language. PHP is 100% written in "C" and there is no virtual machine as in Java. Nothing can beat "C" language ("C" is a language which never dies!!)
    How did this barely-literate rant get modded up to +2? What difference does it make that PHP is written in C? Java is written in C, and the JIT has some hand-coded assembler in it as well. So what? The HOWTO that is linked to hasn't been updated in 2 years and the benchmarks linked in the HOWTO are no longer even on the web.

    The raw speeds of execution between JSP and PHP may be similar (though I suspect that JSP ends up being much faster once the JIT has kicked in and optimized it, after a few executions). Additionally, there are many different JSP runners (Tomcat is only the reference implementation) and the performance between them can be very large (I recommend the JSP runner by Caucho for performance-critical systems. Besides this, PHP and JSP have a very, very large difference between them:

    PHP is usually run as a apache mod or sometimes, as a cgi. Because of this, it cannot store session state or cache inside of its process (since the process is either apache httpd, or the cgi, which terminates at the end of a page run). To get around this, any session variables get serialized and stored to disk at the end of each run, then un-serialized at the beginning of the request. This also means you can have no application-level caches of database information, since there is no place to put these. This is fine for small stateful sites or large stateless sites, but for any serious, large web application that has to maintain a lot of state, this ends up being a big performance disadvantage.

    JSP, on the other hand, is run from a servlet runner in a persistent process outside of the apache process. At the beginning of the request httpd makes a socket connection (usually a local unix socket, very fast) to the servlet runner and sends the request there. This is slightly more overhead than everything running in-process, but gives you the huge advantage of being able to cache whatever data you wish to inside the servlet runner's process. This means database lookups can be cached, sessions don't need to be stored in disk, timers for maintenance functions can be set, all within the servlet runner's process. This is great for large, complicated web applications but obviously not great for small, stateless systems, since it requires the overhead of a running JVM at all times you want the application to be available.

    Two different types of systems, two different purposes. I happen to use both in my professional web development, but use only java servlets and JSP for serious projects.
  9. Re:Windows Users by Richard_at_work · · Score: 3, Insightful

    Not at all. Windows comes on one architecture, so binaries are perfectly acceptable as the default install medium. THere are compatable compilers that you can source if you want. Linux/BSD/Unix needs the default install medium to be sourcecode precisely because of the number of architectures that they run on. Elementary when you think about it, windows simply doesnt need sourcecode by default, yet its available if you really want it.

  10. Re:Does it really matter? by Richard_at_work · · Score: 3, Insightful

    Because its trivially easy to code for a apache/php/mysql combination on a Windows system, while the production server is running on linux/BSD. Usually it helps to have a quick and dirty test environment available, and thats where apache, php and mysql on windows comes in. Install it and you have a vastly similar environment to the production box, without going outside the development machine. Ofcourse you then test the code on a live-test server to ensure the cross platform hasnt introduced any obscure bugs, but it rarely does.

  11. Re:Does it really matter? by ymgve · · Score: 3, Insightful

    Cost. Legality.

  12. Re:Yawn by c13v3rm0nk3y · · Score: 2, Insightful

    ...I've begun to recognize a pattern in software: when will we see the end?

    Well, never.

    Software design is unlike most every other discipline in the world. Your job is never finished until the product is dead. There are always bugs to fix, inconsistencies to remedy. Even the action of fixing bugs will create or uncover new ones. The fact is, if you release version 1.0, by definition you will also have to release version x.y for the entire life-cycle of the product. This also implies that versions may not be infinitely forwards- or backwards-compatible. At some point you have to abandon old releases.

    Look at netBSD; it isn't dying, it's still working on its number-one goal: security.

    According to the netBSD Goals page, security is not paramount. Certainly it take back seat to correctness of code, performance and wide platform support. Perhaps you mean OpenBSD? Either way, if you are going to make security your number one goal, you are compelled to updating and maintaining your code base! Security is a job that is never finished.

    What if Linux all-of-a-sudden wanted to become a Micro Kernel? What if Microsoft(R) Windows(TM) all-of-a-sudden wanted to become a Micro Kernel?

    Well, one of the early criticisms of Linux was that it wasn't a microkernel design. Some MINIX folks really thought Linus was taking a step backwards, though his intention was just to run a real UNIX on his intel box.

    The NT kernel can be considered a microkernel. Very few "pure" microkernel implementations exist, and even fewer exist in the wild. By most definitions the Windows NT kernel is a microkernel.

    Anyway, it's a moot point. Yes, redesigning the Linux kernel to be a microkernel would be significant, but this is why they have odd-number releases to shake the biggest bugs out. Architecture changes like this are part of any long-running project. Do I think they should do it? No. Do I think it would be more are less Linux? Again, no. If the only thing we could call linux is 2.4.x then the project is dead for sure.

    How Microsoft or the PHP people label their respective products is really not that important. I'm not sure this is any kind of trick. Oh sure, Microsoft wants to make sure that people stay current, so it markets the latest release as The Best Ever, You'll See, but everyone does that. It helps their bottom-end in all sorts of ways, not just in immediate units sold.

    Supporting old releases is expensive and painful. Few companies can afford to do so. How old releases are grandfathered is important, but we have to realize that old software must die. Personally, I'm glad Microsoft continued making improvements to Windows over the years (aren't you?). I just don't give a shit what they call it, as it is obviously cut from the same cloth when I fire up my desktop at work.

    Does anyone think they should continue calling those products by their initial names AFTER the programming syntax and methodology becomes completly different or non-compatible than they were first designed?

    I certainly do not agree.

    The fact is that PHP 3, PHP 4 and PHP 5 all do the same sorts of jobs. The language will continue to run blogs and forums, process forms and maintain accounts for porn sites. That will not change. Eventually, as 5 matures it will replace 4 as the dominant release in current use. PHP is right for bumping the major version number when major architectural changed have been made. Whether or not syntax changes all that much (and from my review of the top article, the syntax of the language is not about to change radically) is relatively unimportant. As long as the provider (PHP) gives the implementer (the PHP developer) a heads-up on those changes, and sufficient time to revie

    --
    -- clvrmnky
  13. Re:Kinda kludgey by elbobo · · Score: 3, Insightful

    If there was some way that you could allow the user to have multiple PHP versions all being used as Apache modules where the user could select the one they want using their .htaccess file, that would be a possible solution.

    To my knowledge this is easily doable, and often done. Although I've never properly looked into it (I keep as far away as possible from virtual hosted environments where this would make sense), I believe the idea would be to compile apache modules for each different version of php you wanted to support, LoadModule each one in in your httpd.conf, then bind each one to a specific file extension (.php3, .php4, etc).

  14. PHP fragmentation, lack of cohesion by theolein · · Score: 4, Insightful

    I've been using PHP since the 3.0 days and always loved it's speed in development for small dynamic sites. There is truly nothing simpler (IMO) for small sites. Why on earth did PHP ever become so popular as compared to Perl/CGI? It was the simplicity.

    Most people accepted the changes from PHP3 to PHP4 without complaining as PHP4 brought simple session support and other needed features. Thousands of developers wrote scripts for small pages and uses, and those scripts got placed on help sites etc all across the web.

    The changes above 4.06 where register_globals got turned off by default and -from a simple beginners point of view- to 4.2 where a stunning array of new arrays were added for sessions, post and get variables. Those things broke almost everybodies scripts, and all those thousands of scripts across the web no longer worked as is. Due to this a lot of ISP's no longer upgraded regularly.

    At the same time PHP started jumping on the "web application" gravy train, something for which PHP with it's awkward OO support (no automatic calling of parent constructors etc), lack of stateful session support etc was not designed to do. The makers of Zend decided to go the whole hog and redo OO support, add hundreds of seldom used features but ignore problems with backward compatibility and language simplicity.

    Congratulations. Now we have a language that is slowly matching JSP in complexity (as all the 1337 "application developers are saying"), is nowhere nearly as well integrated in in true web applications as JSP is (great, it can support Java classes, how many will simply use Java then?) and is leaving the roots of it's enormous success behind.

    Take a lesson from Perl's "failure" in web site popularity. Don't keep on adding features for the love of it.

    1. Re:PHP fragmentation, lack of cohesion by aint · · Score: 2, Insightful

      BOGUS.

      First of all, the superglobals you speak of were introduced in PHP 4.1.0 not 4.2.0, and register_globals was turned off by DEFAULT (default being the keyword there) as of PHP 4.2.0, not 4.0.6. And this is not the reason why ISP's don't upgrade as configurations can be changed. This is why announcements announce these changes, why ./configure mentions it, and why it's so heavily documented. This is also why PHP has a file named php.ini

      Regarding complexity, the new PHP 5 features are OPTIONAL, you do NOT have to use OOP at all. It's your choice. You, the user, are given choices, so it's up to you to use whatever you want. The backwards compatibility remark is funny as a typical member of the PHP-DEV team is very aware of BC and tries abnormally hard to keep it. There is even a PHP 5 directive named zend2.implicit_clone to help out with these ZE2 changes.

      Basically, this post is silly and the "insightful" rating is bogus. Your typical naysayer hard at work.

  15. Re:Yawn by damiam · · Score: 3, Insightful
    I'm looking forward to some intelligent answers.

    You're new here, aren't you?

    --
    It's hard to be religious when certain people are never incinerated by bolts of lightning.
  16. Re:Yawn by Hard_Code · · Score: 3, Insightful

    "I know Perl5 accomplished its goals, and then they had an {ap-if-in-ee} to add the RegEx in yet another release of Perl titled Perl6."

    Have you even READ anything about Perl6? Any of the apocolypses or exegises? After lots of incremental crud got added in the (very successful) Perl5 series, they are stepping back, rethinking, refactoring, and reimplementing with a very clear and concise goal of optimizing the syntax for the most used cases, as well as fixing known warts. Additionally they are doing this on top of a generic reusable virtual machine, instead of an ad-hoc specific-use interpreter. I don't even like Perl and I realize that Perl 6 is a Good Thing.

    --

    It's 10 PM. Do you know if you're un-American?
  17. Re:The obligatory predictions... by ceeam · · Score: 2, Insightful

    Practical Extraction and Reporting Language -> PERL. Huh? Not?

  18. Re:Turning into Java? by pnatural · · Score: 2, Insightful
    Python has abstract classes:
    class Foo:
    pass

    class Bar(Foo):
    pass

    assert isinstance(Bar(), Foo)
    Interfaces aren't an issue, either. Sun(tm) Java(R) has the notion of interface to get around a language flaw -- lack of multiple inheritance. Python has MI and thus doesn't need interfaces.