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

24 of 398 comments (clear)

  1. They pulled MySQL out! by baptiste · · Score: 5, Interesting
    Check this:
    Due to issues surrounding the MySQL 4.0 license, the MySQL are no longer bundled with PHP. For more information on these licensing changes, please refer to the MySQL Licensing Policy.
    Wow - that's not a smart move. I guess this is a GPL (MySQL) vs Apache (PHP) license issue? Anyone have more details?
    1. Re:They pulled MySQL out! by CausticWindow · · Score: 5, Informative

      Check this thread on Google groups.

      --
      How small a thought it takes to fill a whole life
    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

  2. Improved OO! by Anonymous Coward · · Score: 4, Funny

    That's right, now you can say class { @P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
    @p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q *=2) +=$f=!fork;map{$P=$P[$f^ord
    ($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[ P.]/&&
    close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];slee p rand(2)if/\S/;print }

  3. Turning into Java? by alannon · · Score: 5, Interesting

    Take a look at the OO changes page. The syntax seems to be converging with Java. I find this amusing in some ways.

  4. 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 larry+bagina · · Score: 5, Informative
      I agree. Even though there are huge differences between version 3 and version 4 (and now version 5), there are also lots of differences between minor versions -- stuff like new functions, changes to how functions work (beyond just bug fixes), etc. Nevermind that there are hundreds of optional libraries and setup parameters, making every installation unique.

      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.

      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.

      --
      Do you even lift?

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

    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 Motherfucking+Shit · · Score: 4, Interesting
      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.
      The only major compatibility issue that I can think of between, say, the 4.1 branch and the 4.3 branch is that register_globals defaults to 'Off' in newer versions. If you leave it that way after installing, then yes, a lot of older scripts will break. Most of the shared/virtual hosting providers I've had to do script installs on, which have actually upgraded their PHP versions, just installed 4.2x or 4.3x and then manually turned register_globals back to 'On' in the php.ini file.

      To the best of my recollection, there isn't much else that's not backwards-compatible. Even where functions have been renamed (e.g. socket_get_status), the old function names still work, and while deprecated, they don't seem to be going anywhere soon. I have no trouble digging up stuff I wrote back in '99 or 2000 and getting it to work under PHP 4.3; though I do have to enable register_globals in those cases.

      Only problem I ever ran into with PHP where stuff quit working after an upgrade was on a test Apache2 server. It turned out to be a bug related to posted form data. I wouldn't use Apache2/PHP on a production server yet anyway, though; and 1.3.27 still gets the job done. I haven't had time to play with PHP5 yet, so I'm not sure what the differences are in that version.

      I agree at the surprising number of hosts who simply haven't updated, though. There are a lot of hosts still running 4.1x, and even (yikes) 4.06, who just won't upgrade for whatever reason. I do most of my coding these days on 4.2 or 4.3, and have run into plenty of belligerent hosts who refuse to upgrade from a two-year-old release. Typically I just have my clients move to a better host; the providers who don't stay reasonably with the times will eventually figure out that it's hurting their bottom line.
      --
      "BSD: Free as in speech. Linux: Free as in beer. Windows 10: Free as in herpes." --Man On Pink Corner in #52607549.
  5. Re:mysql? by Triumph+The+Insult+C · · Score: 5, Informative

    --with-mysql=/path/to/mysql

    bundled being the key word

    --
    vodka, straight up, thank you!
  6. The obligatory predictions... by UsonianAutomatic · · Score: 5, Funny
    1. PHP Sucks, Perl is a much better language.
    2. PERL sucks, PHP does most of the same stuff Perl does but you can still read your own code a week later
    3. PHP isn't a real language, it's just a bunch of wrappers thrown around stuff. PHP sucks.
    4. Who cares about MySQL support, MySQL's not a real database anyway. MySQL sucks. PostgreSQL rulez.
    5. WTF I upgraded to PHP 4.1.2 and all my form submit scripts stopped working. Whats this register_globals crap anyway what a pain.
    6. Continue with language specific criticisms; loose typing, OO not as strong as Java, et cetera.
    1. Re:The obligatory predictions... by glwtta · · Score: 4, Funny
      You forgot the obligatory followup to number 2:

      WTF is "PERL" anyway? PHP sucks, Perl rules.

      --
      sic transit gloria mundi
  7. Requires Microsoft Visual C++ by yerricde · · Score: 5, Interesting

    MySQL isn't bundled with it, but you can easily add it yourself when compiling.

    Compiling?

    Compiling PHP for Windows requires the Microsoft Visual C++ compiler version 6.0 or later.

    The Microsoft Visual C++ optimizing compiler version 6.0 or later is available only from Microsoft as part of Microsoft Visual Studio .NET, which costs $1,079 for one non-academic seat. (Microsoft no longer sells a Visual C++ optimizing compiler separately.)

    Some people are bound to bring up the $109 Microsoft Visual C++ Learning Edition, but 1. the EULA attached to its library probably does not permit distribution of generated binaries nor public performance (i.e. use on a public web site) of generated binaries, and 2. because it does not have an optimizer, the speed of generated binaries is closer to that of an interpreted program than to that of a compiled program.

    If I had any spare time, I'd fix this by porting the build to MinGW.

    --
    Will I retire or break 10K?
  8. 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?

  9. Re:Still re-coding for register_global_variables.. by FryGuy1013 · · Score: 5, Informative

    um..

    extract($_POST);
    extract($_GET);
    extract($_COO KIE);

    ?

    --
    bananas like monkeys.
  10. Re:Kiss and say goodbye to Java language!! by crunchywelch · · Score: 4, Informative

    Uh, none of those links work, however here is a *recent* comparison of JSP and PHP using several different containers for JSP and PHP. It seems that the server setup has a great deal to do with the speed of the application (duh).

    It's interesting that people like to make comparisons to JSP and ASP all the time but don't remark on what platform they run on. Obviously JSP running on tomcat/apache through with mod_jk will be slower than with just plain Resin.

    And open should note that a statement like ' Kiss and say goodbye to Java language!!' almost sounds like a troll, when you consider Java is used for a great deal more than web applications, indeed the servlet functionality that JSP relies on is a *very* small portion of the overall tools that Java supplies to developers.

    But whatever, use the right tool for the job and try to remember it's technology, not religion. The more options the better IMO.....

    --
    1400x1250 in a 640x480 world...
  11. 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.
  12. FREE!! -- PHP Encoder and Cacheing -- FREE!!! by Anonymous Coward · · Score: 5, Informative

    Yes yes.. To sooth all the scalp scratching surrounding PHP and FREE (quality) cacheing and encoding look no futher than

    MMcache - http://www.turcksoft.com/en/e_mmc.htm

    It's only a split second .001 slower than zend (faster than PHP Accelerator) and it FREE! Did I mention it works with Zend Optimizer , Zend Encoder and it can also Encode (protect) PHP files?

    I'm too damn good to you people! ; )


    PS: PHP makes programming fun again. Thats why people like to use it. Simple really.

  13. PHP 5 Documentation update by aint · · Score: 4, Informative

    PHP 5 isn't really documented in the PHP 5 manual yet as there are still a few features on the move, and new features to come, but here's a list of PHP 5 related articles and presentations:

    Faq: Where can I get more information about PHP5?

    Enjoy!

  14. Re:Yeah Yeah... by Second_Derivative · · Score: 4, Informative

    Nah, I reckon one could handle it like this...

    <VirtualHost *>
    ServerName www.myhost.com
    DocumentRoot /home/myhost/engine.php
    Alias /res /home/myhost/resources
    </VirtualHost> ... or something. I tried it on my server and it seems to work a treat. Once again cheers for the tip

  15. Re:Kiss and say goodbye to Java language!! by Anthony+Boyd · · Score: 4, Interesting
    PHP is 4 times faster than Java technology 'JSP' (Java server pages).
    Substantiate that statement.

    Hey HeadDown. You're right to take the guy to task, s/he made some crazy comments. But I can at least partially substantiate speed issues. Back in 2000, I worked with Sabeer Bhatia (the Hotmail guy) on a startup called Arzoo. Our product (a Web site similar to epinions) was almost 100% Java, except for a bit of Perl for screen-scraping and searches. But anyway, it was slow -- first with Tomcat, then with JRun. At one point, we gave a private preview to 1,000 journalists. They didn't even visit the site all at once, they trickled in over the course of 3 days or so. Just that was enough to hammer the site. We ended up running cron jobs that would reboot the farm, round-robin, just to solve memory issues and instability.

    Now, you can say, well, that was 2000! Try it now! OK. At SST, we have a team that is using Tomcat now. Although the instability is gone, the speed is still an issue -- they have wait screens as you click through the app. My team is working with PHP, and has no wait screens, and no need for them (with 1 exception). Our pages are actually more computationally stressful than the Java stuff, yet PHP is delivering the result to the browser faster.

    As a final point, you might suggest that the teams I've worked with do not understand Java or how to run it well. It's no skin off my back if you make that argument -- it's not me doing this stuff, so no blow to my ego. But I think working with 2 different teams over the course of 3 years says something. Perhaps, at the very least, if Java really can handle a bigger load, it is so difficult to tune that mere mortals would do better with PHP.

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

  17. Re: Just use PEAR/DB by PizzaFace · · Score: 4, Informative

    Instead of ODBC, you'd be better off using the pear/db module as middleware. It supports more databases (mysql, odbc, sqlite, pgsql, etc.) and if it isn't the future standard for database access in PHP, something like it will be.

    I've been using PHP's built-in (until now) MySQL functions, because they're faster than pear/db, but this licensing dust-up has convinced me that portability among database vendors is worth a performance hit. And the pear/db module is getting increasing attention and is likely to get faster.

  18. Re:Yeah Yeah... by pacman+on+prozac · · Score: 4, Informative

    My biggest complaint about PHP is the joke that they pass as "error handling". Yeah great, thanks for exposing all my path names to the outside world if something goes wrong.

    Psychic abilities will be added to PHP as of version 6.6.6. From here on you will be able to simply think of the configuration you want and it will be set in php.ini. No longer will you have to read the extremely comprehensive online docs including the manual and especially not the ENTIRE SECTION dedicated to error reporting and logging that tells you extremely clearly how to do what you have just complained is impossible. You would not need to read that page and find the two links within the 1st side that show very clearly information on the display errors, error_log for custom logs and of course log errors to put the errors in the apache logfile.

    Your biggest complaint is that you are too lazy to read the manual and you expect everything to be done for you. No programming language can help you with this.