Slashdot Mirror


PHP 5 Released; PHP Compiler, Too

TheTomcat writes "After years of anticipation, PHP 5 was released today. This release represents a milestone in the evolution of PHP. It sports the new Zend Engine II, a completely re-worked object model, and many many new features. Check it and the changelog out." In other PHP news, remote_bob writes "There have been many attempts, like BinaryPHP and PASM, but finally there is a complete compiler for PHP. The Roadsend compiler produces standalone, native executables, and supports the entire PHP language (but not all extensions). It uses Bigloo Scheme to do its job, a variant of Lisp, the language that Paul Graham writes about. Benchmarks say that performance is pretty good. Is this another sign that dynamic languages are the future?"

113 of 524 comments (clear)

  1. So it is out... by Necromutant · · Score: 3, Insightful

    ...but who will use it for another year or two?

    --
    ~Necromutant
    1. Re:So it is out... by Rosyna · · Score: 4, Funny

      No, the correct response is, "So it is out... but will it get me laid?"

      The answer is, "Depends on if you wrote PHP5 or if you just write with it."

    2. Re:So it is out... by Anonymous Coward · · Score: 2, Funny

      People who write with PHP are more likely to get laid, out of sympathy. Girls take one look at the mess that is PHP and say to the developers holy shit, I'm not sleeping with someone who can't make a halfway consistent API thanks.

    3. Re:So it is out... by maxdamage · · Score: 3, Interesting

      Me for one. My site is now running it!

    4. Re:So it is out... by Kosgrove · · Score: 2, Interesting

      Let me preface this by saying that I take a moderate stance in the Windows/Linux never-ending holy war and while I haven't developed extensively in PHP or ASP, I think I have a decent grip on the capabilities of both.

      I found ASP MUCH easier to read. It's at least pseudo-OO. There's a reason why Visual Basic (and VBScript-based ASP) is so incredibly popular, even besides the prevalence of MS' operating systems: it's VERY well designed and very readable.

      Now, throw in ASP.NET, (which admittedly is a whole different language) and its compiled (rather than interpreted) pages and you've got a much better (IMHO) language. Also, the Interdev IDE is far better than any IDE I've seen for PHP. (Not that one doesn't exist - I just haven't seen one.)

      That said, I've found that PHP as a shell scripting language (In Linux of course) has allowed me to accomplish some system administration tasks that would've taken me forever using BASH scripting (because I know very very little).

    5. Re:So it is out... by Misunderstood_Geek · · Score: 2, Funny

      It got me laid once ... but she was a hippie ... and she thought it meant People Helping People.

  2. Goodbye Perl? by FyRE666 · · Score: 3, Interesting

    This may well sever my last remaining link with Perl. While I used to ride the camel for web and shell scripting, I've now moved entirely to php for the web, and mostly php for shell scripting, with Perl used when its extra speed is useful. Presumably compiled php will eclipse Perl for scripting use now though, so (on Linux at least) I'll probably convert fully. Pity I have to stick with sed, awk and shell scripts on our old HPUX servers though...

    1. Re:Goodbye Perl? by KevinKnSC · · Score: 5, Interesting
      I agree, this makes it hard to justify something besides PHP in a lot of situations.

      It's too bad the compiler is $399 per year, and only currently available on Linux. If it was a little less, and not licensed annually, I'd be uninstalling a lot of other development tools right now.

    2. Re:Goodbye Perl? by defsdoor · · Score: 2, Interesting

      I thought I was the only person that used php for scripting too. I've got a landline call rating system that runs superbly written entirely in php.
      It started out as a prototype but worked so well and fast that it stayed.

    3. Re:Goodbye Perl? by Tyler+Eaves · · Score: 5, Informative

      Any decent language has full PCRE support these days. Perls days as regular expression king are in the past. Sure it may have set the standard for how it's done, but now it's no longer a selling point. Plenty of other nicer languages exist.

      --
      TODO: Something witty here...
    4. Re:Goodbye Perl? by mentatchris · · Score: 3, Insightful

      Perl is still an excellent option IMHO. For me, the most important feature of a language is the amount of support available. Perl has so much documentation scattered around the web, it's usually very easy to find an example or get help with a problem. Also, the books are now all on version 2+, meaning most of the bugs have been worked out. With my Safari access, I have years of resources at my disposal. While I appreciate all that PHP offers, I still haven't been convinced that it is good enough to make me switch. The resources out in the community are far too attractive for me to fight my way back up the learning curve.

      Plus, is there any greater comedian in the community than Larry Wall?

    5. Re:Goodbye Perl? by FyRE666 · · Score: 3, Interesting

      I don't think there's much of a learning curve going from Perl to PHP - the other way there would be though! PHP closely resembles Perl in many ways - it has certainly been influenced by it to a greater extent than any other language I can think of.

      I've been using Perl for around 10(?) years and while I appreciate its regex engine is faster than PHP, and the CPAN modules offer things PHP doesn't have (at present), you can put almost any web app together far faster with PHP than Perl. IMV this also goes for most database driven shell scripts.

    6. Re:Goodbye Perl? by MourningBlade · · Score: 2, Insightful

      Any decent language has full PCRE support these days. Perls days as regular expression king are in the past. Sure it may have set the standard for how it's done, but now it's no longer a selling point. Plenty of other nicer languages exist.

      C has full PCRE support. That doesn't mean its regexp support is royal.

      One of Perl's advantages is just how tightly integrated into the language regexps are. I haven't seen PHP5 yet, I hope it's better than PHP4. I'm just saying that PCRE support does not a good regexp language make.

    7. Re:Goodbye Perl? by LostCluster · · Score: 2, Funny

      $399 per year for nothing more than a compiler puts it at roughly at the same price as the entire Microsoft Visual Studio... seeing that you get about 2-3 years out of the typical VS release.

    8. Re:Goodbye Perl? by prockcore · · Score: 2, Insightful

      Plenty of other nicer languages exist.

      The biggest problem with PCRE in PHP is the escaping problem. PHP needs something so you don't end up with having to type \\\\ to match a backslash.

    9. Re:Goodbye Perl? by xa0s · · Score: 3, Interesting

      I'm a longtime Perl programmer, and while I've seen Perl having been taken over by PHP on the web side of things, Perl still sees enourmous use in generic *nix system world. For example, in the company I work for we use many programming languages on many architectures, and Perl has consistently been the duct tape that ties them all together. We even have a dedicated infratructure team that maintains the various releases of Perl and our core Perl APIs. I dont think Perl will ever completely die(), but it's use in certain areas has certainly diminished.

      Although I haven't done much more than quick hacks to PHP scripts, I still prefer to use Perl for everything. Every time I've tried to seriously use PHP for web stuff, I always go back. I end up missing the syntax, idioms and CPAN. I suppose its just a matter of personal taste.

    10. Re:Goodbye Perl? by LetterJ · · Score: 3, Interesting

      I do an *awful* lot of commandline scripting and have an experimental demo of doing PHP with HTA's as a GUI, giving you PHP without a web server, but with a GUI and still using HTML as the GUI language. It's actually pretty slick. You can build HTML forms that are processed by PHP scripts just like they would going through a web server, but run on the commandline instead. It emulates POST and I'm working on emulating XML-RPC next. I'm calling it PHUI (PHP HTA UI) toolkit.

    11. Re:Goodbye Perl? by Christianfreak · · Score: 4, Insightful

      Compiled PHP won't be much faster IMHO. If you want something compiled why don't you write your web apps in C? One of the main points about using an interpreted language is that your app can be changed quickly on the fly which is often nessicary in web development. Doubtful that people are going to start compiling PHP apps anytime soon.

      PHP for shell scripts? That's just strange. ick.

      PHP 5 still lacks namespaces, that alone is a good reason not to switch. That and CPAN (and no before you mention it, PEAR doesn't come anywhere close)

      Since I always get the same replies everytime one of these posts comes up I'll answer them all now.

      I use PHP everyday, its part of my job (sysadmin/web-developer). Have been using it for 4 years. At first I thought it was alright, but the more I've used it the more I loathe it. I find it inconsistant and I find at its core everything that goes against what a well designed language should be.

      Perl code is not ugly unless you make it ugly. You can make C or PHP ugly as well.

      Perl can be used in projects with multiple developers, I work with one other developer on a regular basis, sometimes two. At the beginning of the project we plan core modules and set APIs and coding style, much like I would expect anyone would do for any language.

      IMHO and experience mod_perl is faster than PHP especially in larger apps. /flame on

    12. Re:Goodbye Perl? by metasyntactic · · Score: 2, Informative

      Microsoft makes all its compilers available for free. You can find them all at http://msdn.microsoft.com

      -- Cyrus (http://blogs.msdn.com/cyrusn)

    13. Re:Goodbye Perl? by jswhiting · · Score: 2, Informative

      zend is offering a package that includes the zend accelerator, studio, & encoder for $295 or $450 with upgrades/bells/whistles per year, as long as your company is pulling in less than 100k per year.

      i dont work for zend; i bought the package (think its a good deal).

      if you insist on free software, there are a number of free php code caching apps as well as development ides available...

    14. Re:Goodbye Perl? by ErikZ · · Score: 5, Funny

      I have a very difficult time debugging perl scripts and figuring out how to do new things with it.

      PHP is more like a more friendly. Allows you to fumble around and then gives you informative errors. Kind of like your first Girlfriend. :)

      Well, the first week of her anyways.

      --
      Democrats or Republicans. They are both taking us to the same place and they are not afraid of us anymore.
    15. Re:Goodbye Perl? by MourningBlade · · Score: 3, Interesting

      Of course, she could be like Oracle, where she knows you're not doing it right, but has no suggestions whatsoever on where the problem might lie or how to fix it.

      Perl can be difficult to debug. It's one of those "wide or deep" questions: you can have an extremely simple syntax, and require a ton of code to describe what you mean to do, or you can have a rich syntax and say it more succinctly (even more descriptively, given skill on the part of the writer and the reader).

      All languages are a tradeoff. Glad PHP is where you want to be on that spectrum.

    16. Re:Goodbye Perl? by scrame · · Score: 2, Informative
      Yep. All the Visual Studio 2005 betas are free here

      and also Creative Expression

    17. Re:Goodbye Perl? by senzafine · · Score: 3, Interesting

      At my work we develop alot in PHP. Me and another co-worker started creating a repository of classes which we use like there's no tomorrow. We've gotten a really good system of consistent coding style. Though I can still tell what lines he's written and I've written. But they're formatted the same so a third developer can come in and understand it all as well.

      As far as PHP for shell scripting. I use it when I just need something quick. I'll sometimes go back and change it to a different language when I have time.

      To make a long post short...I'm estatic about php5 being released!

      --
      Better than Flickr - Manage, Share, Archive
    18. Re:Goodbye Perl? by a_karbon_devel_005 · · Score: 2, Informative

      I eat hat now.

      Yes I do use preg_match() quite often, but apparently I've never needed to match a backslash. I humbly apologize, and realize you are correct.

      HOWEVER, other than that I can't think of anything too hard about the quoting style of PHP. You've got interpolated, non interpolated, and HEREDOC. *shrug*

    19. Re:Goodbye Perl? by blankslate · · Score: 5, Interesting

      I'm surprised with all this PHP vs PERL talk that no-one's mentioned that ZEND says you can use PERL from within PHP, as of release 5. Does no-one else find this highly interesting? Anyone tried it yet?

      --
      ---- death to all fanatics
    20. Re:Goodbye Perl? by raju1kabir · · Score: 2, Funny
      However, this gives you completely local PHP apps without having to open a single port in any firewall

      Your firewall blocks traffic from 127.0.0.1 to 127.0.0.1? You're hard core, man.

      --
      "Patriotism is your conviction that this country is superior to all other countries because you were born in it." -- GBS
    21. Re:Goodbye Perl? by fucksl4shd0t · · Score: 2, Interesting

      If you properly abstracted your db layer in the first place, then you're safe to use mysql_* without having to worry about rewriting large sections of your code later.

      Pet peeve: all these open source PHP applications that embed every single fucking query right where they use it. Inheritance works great for this, and I've got an object model put together that solves this problem nicely. Two classes, one that you derive from. That one you call for your data, whatever you need. It (dbPage or dbCategory, depending on what it is, you have to write this one, it's not generic) calls dbBase->Query for the data you requested. dbBase returns true on success, or an error on failure. On success it stores the results in a member, which you then dbBase->Results to get. dbBase also manages the connection and so forth.

      Later on, when I want to migrate to another database, I only have to rewrite *one* class, and PHP happens to provide a number of nice features that'll let me choose which version of the class to use at runtime. And even then, I don't have to rewrite the whole class, just three core methods, all of the others of which are just error-handling based on results from those methods.

      Really, there's very little excuse in this day and age for having to rewrite large portions of your code just because your database changed. Don't we all have some generic db abstractors laying around in our pet languages by now? I've got 'em for php and python (the only languages I use anymore).

      --
      Like what I said? You might like my music
  3. Thanks PHP team by Dreadlord · · Score: 3, Informative

    Doing PHP development has been my main source of income for a couple of years, the new release will make my life much easier, especially the new OOP model, let's just hope that web hosts will upgrade soon.

    Thanks again PHP team!

    --
    The IT section color scheme sucks.
  4. PHP is moving in the right direction by jbellis · · Score: 4, Insightful
    PHP5 looks a lot cleaner than 4, at the expense of backwards compatibility. Some will probably make a lot of noise about this latter, but it's necessary when changing (improving) the language this much.

    Remember, nobody's forcing you to upgrade that site running perfectly well under php4, and you probably shouldn't.

    1. Re:PHP is moving in the right direction by andig · · Score: 5, Informative

      One of our design goals for PHP 5, was to keep backwards compatibility as much as possible. Actually most PHP 4 sites run out of the box with PHP 5. If there are problems, there's a compatibility mode (configurable via php.ini) which makes the object-oriented model behave the same as in PHP 4.
      Bottom-line: Very few people will have problems doing the upgrade. Of course you should thoroughly test your site before upgrading.

    2. Re:PHP is moving in the right direction by Dr.Dubious+DDQ · · Score: 4, Interesting

      I can vouch that, to the extent that I've been trying it, all of my PHP4-developed code has been working fine with the PHP5 interpreter so far. As andig suggests above, I suspect that only a few cases where someone relies heavily on 4.x "quirks" will cause a problem.

      I was slightly disappointed to find that the "native Java/PHP integration" support was quietly dropped from PHP5 - I'd been wanting to play with that. Oh well.

    3. Re:PHP is moving in the right direction by Sokie · · Score: 4, Informative

      A kind of slick way to test your existing code and applications is to do a little -fu in your apache.conf and set it up so you have two instances of Apache running on different ports but using the same DocumentRoot. One instance running the PHP4 module and one the PHP5 module. I've got this set up on my Gentoo dev server with PHP5 running over port 8080. Just add an :8080 to the URL and your page is running through PHP5, I've found it quite useful for playing around and testing. If anyone wants more details just e-mail me. And if you're not using Apache, you can probably set up a similar thing, but I can't really help you there.

      --
      ------
      Where are the slash-groupies? I distinctly remember being promised slash-groupies!
    4. Re:PHP is moving in the right direction by RazzleFrog · · Score: 2, Informative

      I would normally agree with you but the testing on PHP 5 has been so extensive and has gone on for so long (2 or 3 Betas and 3 RC's) that I am pretty confident in it. I have been using it since Beta 2 and I haven't had any problems with it. Premature releases are so ingrained into our mentality that we sometimes forget that there are quality developers out there who do do thorough testing.

    5. Re:PHP is moving in the right direction by andig · · Score: 5, Informative

      Yes I can confirm. We, as in Zend, are working with Sun on the JSR 223. The result will be a Sun reference implementation of the standard (based on PHP) which defines what the interface between PHP (and other scripting languages) and Java will look like.

  5. Cross Platform? by blackmonday · · Score: 2, Interesting

    How is the cross platform ability of PHP? Can I write an app un Linux and comile and run it on OS X and Windows? Does it need a runtime, or is it bundled? Seems like an intriguing alternative to .NET.

    1. Re:Cross Platform? by Dreadlord · · Score: 5, Informative

      Yes the official interpreter is cross-platform, it is available for *nix and Windows.

      Check out the downloads section at php.net for Windows binaries and *nix source, and here you can find more details on PHP under Mac OS X.

      As for the compiler in the story, I haven't tried it before so I don't know.

      --
      The IT section color scheme sucks.
    2. Re:Cross Platform? by man_ls · · Score: 3, Informative

      Very cross-platform...obviously some things like file paths might have to be changed to reflect the filesystem they run on top of (/usr/bin/whatever vs c:\program files\whatever) but with few exceptions, PHP code written on any OS will work on any other one.

  6. the past is the future by ChipMonk · · Score: 5, Insightful

    Is this another sign that dynamic languages are the future?

    I'm starting to think there are no new ideas any more, just re-hashes of old ideas. Unix, almost 35 years old, looks to be once again the wave of the future. LISP is still teaching us lessons. And the command line is still the most powerful sysadmin tool we have.

    1. Re:the past is the future by D-Cypell · · Score: 5, Funny

      I think I might even start porting some of my code to punch cards, by the time they return to the mainstream I could be a 6-figure consultant.

    2. Re:the past is the future by Anonymous Coward · · Score: 2, Informative
      Static/dynamic dictates whether the typing happens at parse/compile time or at run time. Weak/strong dictates what to do when small type-mismatches arise. C is the classic (mostly) weakly-typed language. You can do "double x = int_variable;". You can do "void *blah = &int_variable;". You can do all sorts of crazy stuff.

      Here's a handy table:
      Dynamic/weak: PHP
      Dynamic/strong: LISP
      Static/weak: C
      Static/strong: Haskell

    3. Re:the past is the future by CableModemSniper · · Score: 2, Informative

      In a really simplified explanation:
      Strongly typed - the identifier is typed
      Dynamicly typed - the data (object) is typed
      Weakly typed - the operations on the data are typed

      --
      Why not fork?
    4. Re:the past is the future by ThisIsFred · · Score: 2, Interesting

      Considering the problems with the shelf life of various recordable optical storage, that may be where we all end up!

      --
      Fred

      "A fool and his freedom are soon parted"
      -RMS
  7. PHP5 by mfh · · Score: 4, Interesting

    Some folks were suspicious of PHP5, and being a longtime PHP programmer, I am very pleased with the changes and additions in PHP5. Can't wait to test it out. Personally, I'm not sure if I'll use *all* of the new stuff, yet I'm sure I'll have to play with the coolest additions for the hell of it, and sort out what I'll be using and what will remain vestigial in my scripts. I will add that some of the previous PHP version quirkiness seems to be fixed.

    I am certain this is not the last we'll hear about PHP5 on Slashdot, yet I am only hoping that it's creative/cool stuff, and not security problem/exploit stuff.

    I can't wait to see what kinds of changes I can make to my content management system that PHP5 will bring.

    --
    The dangers of knowledge trigger emotional distress in human beings.
  8. PHP Object Model by Eberlin · · Score: 3, Interesting

    A good reworking of the PHP object model was definitely in order. Inheritance was a bit weird, destructors were odd to work with, and there weren't ways to declare stuff private.

    The bigger question is compatibility. Will older code be ok? When will mainstream hosts migrate to the newer version? It'll be scary to find systems borken because of version updates.

    As for a compiler, I'm not sure I'm comfy with the idea. Always figured if you wanted to write code for native compilation, you'd hack in C or maybe C++. Not that PHP wouldn't have its uses...as PHP is really handy and greatly increases the speed of development.

  9. PHP compiler is nice, but expensive! by MisterJones · · Score: 5, Informative

    http://www.roadsend.com/home/index.php?pageID=faq

    $400 for the license, which is only good for one year. After that, it won't compile until you renew.

    Doesn't seem worth it for the casual hobbyist...

  10. Compiled vs Cached by chill · · Score: 4, Interesting

    If speed and not closed-source is your main consideration, then how does the Roadsend compiled code stack up against interpreted code fed through the Zend Accelerator, the Turck MMcache or other caches?

    mmCache is OSS and free (as in beer), which is a big plus in my book.

    -Charles

    --
    Learning HOW to think is more important than learning WHAT to think.
  11. $$ for compiler by hkb · · Score: 2, Interesting

    Uhm, the compiler is priced at a low, low introductory price of $399. I don't think it'll be taking the *NIX world by storm any time soon, or cause mass adoption to PHP executables anytime soon.

    --
    /* Moderating all non-anonymous trolls up since 2004 */
    1. Re:$$ for compiler by NoMercy · · Score: 2, Informative

      Well that makes it pretty worthless.. on a plus side if they sell it there's likely support and other features which would make php more of a option in business.

      And if they can do it, why can't we... how long till GCC compiles php code?

    2. Re:$$ for compiler by Saeed+al-Sahaf · · Score: 2, Interesting
      Well that makes it pretty worthless.. on a plus side if they sell it there's likely support and other features which would make php more of a option in business.

      Not really. Most people interested in compiled PHP are working in the "enterprise" market. $400 for a commercial compiler is not that bad.

      And if they can do it, why can't we... how long till GCC compiles php code?

      I think most people who have the skills to write something like a compiler generally want to make a living from their work, hence the $$. But, I agree it would be nice...

      --
      "Who are in control, they are not in control of anything - they don't even control themselves!" - Glen Beck
    3. Re:$$ for compiler by prockcore · · Score: 5, Interesting

      Uhm, the compiler is priced at a low, low introductory price of $399. I don't think it'll be taking the *NIX world by storm any time soon, or cause mass adoption to PHP executables anytime soon.

      The price is nothing. If you're running a site that requires compiled PHP, $399 is a joke. The thing holding the compiler back isn't the price, it's the lack of Solaris support.

    4. Re:$$ for compiler by Muerte2 · · Score: 4, Funny

      I think most people who have the skills to write something like a compiler generally want to make a living from their work

      You mean except for those dirty commie gcc guys!

  12. Awesome! by Anonymous Coward · · Score: 3, Funny

    Now that PHP has stopped imitating Perl, and started imitating Java, I can write some Java-look-alike code while still simple-mindedly sneering at that language as inefficient and bloated!

  13. Re:PHP Compiler by KevinKnSC · · Score: 3, Informative
    From the site:

    The compiler generates binary code that is executed directly by the CPU, avoiding the intermediate process of compiling to bytecode and running in a virtual machine

    That's a true native compiler to me.

  14. A Book Recommendation by z0ink · · Score: 4, Informative

    For those who are not new to php, but wan't a good primer for PHP 5 I would definatly recommend this book by George Schlossnagle. Advanced PHP Programming was recently reviewed here and it was upon reading that review that I decided to pick up a copy. It serves as an introduction to OOP to those who are unfamiliar and does a good job in covering the specific mechanics of how things operate in PHP. The book even includes some good info on some Zend Engine hacking.

    --
    Steal This Sig
  15. Re:Am I the only one... by cyberlotnet · · Score: 5, Informative

    PHP itself including the zend engine is 100% opensource, You can download the source you can browse the cvs to your hearts content and see everything.

    The products they produce to support the development of php the closed source.

    You do not need to touch, use or otherwise dirty your poor soul with any "non-free" software to use php.

    There is nothing wrong with this business model, get over it.

  16. not trying to start a flamewar by abes · · Score: 5, Interesting

    I used to really be into PHP. It was great for creating a webpage in little or no time. It's syntax, while maybe not perfect, was pretty good. Until, that is, I tried to start developing my own libraries, and ran into weird quirkiness with object design, and trying to figure out the best way to do libraries, etc. It looks like PHP5 might fix the problems I had with how objects worked, and I'm not sure if it was my own fault with the messy libraries I ended up with, or whether I didn't find the best way to do it in PHP, but I eventually moved to Python out of frustration.

    I had avoided Python for a long time, as I really disliked (and still do) the indentation-matters issue. But besides that, and its own set of quirks, it's a really great language, and for larger projects I have trouble even thinking about going back to PHP.

    I think the biggest selling point to PHP over other solutions such as Python is that its simple. You don't have to make a whole of choices. For example, with Python you have a large number of packages to choose from: Zope, mod_python, twisted.web, Python CGI, and a bunch of variants on these. While choice can be good, it can also be overwhelming (like how do you know which package to go with until you've tried them all?).

    I think I am not alone with some of difficulties I faced with PHP. So while it's great to hear that PHP has fixed many of its bugs, I think its worthwhile for people to also look at other solutions out there.

    Just my $0.02.

  17. IonCube by JohnnyBigodes · · Score: 2, Informative

    Speaking of PHP compilers, there's a good and very affordable solution from IonCube as well.

    (no, I have no affiliation to them)

    1. Re:IonCube by mdfst13 · · Score: 2, Informative

      That's not a compiler in the same sense; it's an encoder. It allows people to store PHP scripts as a proprietary code (it's actually a lot like java). A true compiler creates native machine code.

  18. PHP5 is out... by TiggertheMad · · Score: 4, Funny

    ...does the FBI know about this? I have heard about some of the PHP busts in recent years, but all this talk about how 'powerful' this new PHP is makes me wonder how dangerous it is. It sounds expensive, too. I hope that this doesn't lead nice young kids, into a life of crime. Imagine, hords of young, glassy-eyed kids stealing stuff like...video games and movies just to fund their PHP habbit.

    Damn kids.

    --

    HA! I just wasted some of your bandwidth with a frivolous sig!
  19. Dynamic languages? by JessLeah · · Score: 2, Interesting

    What the heck does that mean? Is that a fancy way of saying "Compiled languages"? (I somehow doubt it) What precisely is meant here? Is a dynamic language "a language that can be either compiled or interpreted"?

    1. Re:Dynamic languages? by Waffle+Iron · · Score: 5, Informative
      Dynamic language usually means "dynamically typed". This means a typed language that associates type information with data values, not with variables. (i.e, the language keeps track of types, but any variable can hold a value of any type)

      Sometimes, it also implies things like dynamically extensible type definitions at runtime, automatic memory management, and support for various functional-style features such as closures.

      Compiling a dynamic language to machine code is usually a challenging problem.

  20. Re:Am I the only one... by Dr.Dubious+DDQ · · Score: 2, Funny

    AUGH! And now I've violated your copyright by creating a derivative work by replying to your post without permission!

    (I'll stop now. It's just too easy to make fun of the current interpretations of "Intellectual Property"...)

  21. Re:Let the PHP flame war begin! by blackmonday · · Score: 4, Funny

    I would prefer to say "Begun, the PHP flame war has".

  22. PHP 5 Tutorials by aint · · Score: 3, Informative

    For a list of PHP 5 related tutorials and articles check out this faqt or simply look around the faqts PHP 5 section.

  23. "Student Suspended OverSuspected use of PHP" by Dr.Dubious+DDQ · · Score: 4, Funny
    Imagine, hordes of young, glassy-eyed kids stealing stuff like...video games and movies just to fund their PHP habit.

    Too late...

  24. PHP 5 Section on Zend.com by andig · · Score: 5, Informative

    If you'd like to see what's new in PHP 5, we got some of the leading PHP developers to write about new extensions they developed.
    I also posted the first chapter of my PHP 5 book in that section which gives an overview of what's new in PHP 5. This book will be part of the Bruce Perens series of Prentice-Hall and will therefore be open-source and freely accessible to anyone.

  25. Re:Am I the only one... by doe · · Score: 4, Interesting

    Roadsend is a development house unrelated to the PHP development team. I doubt that their compiler would make any noticable impact since they don't support many of the PHP's most useful extensions. I have not tested it but it looks to me that the people that would be interested in this are those that want to close source their own PHP code so I guess its only fair to pay for it.

    Many useful PHP tools are open source. From the bytecode compiles such as APC and MMCache, debuggers (APD and XDebug).

    I see tha fact that there are some companies out there providing commercial tools for PHP developers as a good thing(tm).

  26. Yahoo Store, of course, is in LISP by Animats · · Score: 4, Informative
    LISP is a good match for operating on HTML and XML, both of which are really tree structures. Operating on trees works very well in LISP. That's what it's good at. Perl, PHP, and Java don't do trees well. You have to hammer the tree into an object paradigm, which doesn't help all that much. Perl's representation of a tree is rather inefficient, too. I do considerable parsing of large documents into trees in Perl. It works, it's portable, it's slow, and Perl is badly matched to the task. PHP is worse.

    LISP's parentheses turn everybody off, including me, but the data structures really are a win for tree-like applications.

  27. The future of programming languages: LabView by heyitsme · · Score: 2, Interesting

    Dynamic languages the future? Unlikely. The future of programming is more likely in code that isn't written, but rather "drawn"

    Many people haven't heard of LabView, even though it has been around since the late 80s. It runs on Windows, Mac OS, and Linux. The premise behind LabView is there is no such thing as written code. Instead of code, applications are literally drawn by dragging variables (controls, indicators) onto the block diagram and wiring them together. For instance, if I wanted to add 1 and 2, I would create two integer objects with respective values, find the addition function, and wire them together to an output (indicator - think text box). I have written entire graphical application suites/analysis tools in a matter of days and weeks instead of months (had I written them in, say, C or Java or $your_texT_based_language_of_choice).

    The only issue many will have with LabView is that it is expensive. It is also closed source, but hey, so is Java. Anyone interested in rapid application prototyping/development or digital/analog instrumentation should check out LabView.

    1. Re:The future of programming languages: LabView by t_allardyce · · Score: 2, Insightful

      The problem is i can type "x = 1 + 2;" allot quicker than i can click to create two objects, click on each and give it a value, create a 3rd object and draw two lines to wire it together. Also whenever i use a block system (spent some time with simulink/matlab at uni) i always start trying to make the boxes line up and look neat, where as coding is just a matter of pressing tab a couple of times.

      --
      This comment does not represent the views or opinions of the user.
    2. Re:The future of programming languages: LabView by warrax_666 · · Score: 2, Insightful
      Many people haven't heard of LabView, even though it has been around since the late 80s.

      Maybe, just maybe, there's a reason for that.

      While "graph" programming may be useful for data flow programming, it's absolutely useless for general purpose programming. For general purpose programming the devil's in the details and introducing a "graph" programming language just moves you further away from the details without actually giving you control of the details (see Joel Spolsky's article about "leaky abstractions" as to why this is a bad idea).
      --
      HAND.
    3. Re:The future of programming languages: LabView by horza · · Score: 2

      Dynamic languages the future? Unlikely. The future of programming is more likely in code that isn't written, but rather "drawn".

      This has been coming up regularly since the 80s. I've seen apps like this, and even tried writing my own version, and recently there was a fad for UML->code compilers. The fact is that it's not going to happen. It's far quicker to type than it is to draw. Also you can fit a lot of code on one page making it easier to debug, as opposed to scrolling through vast screens of visual representation. The saying may go "a picture is worth a thousand words" but it certainly doesn't apply to coding.

      Phillip.

  28. Re:Am I the only one... by drmike0099 · · Score: 4, Interesting

    There's certainly nothing wrong with this business model, although that's no reason to not be concerned about potential problems. As you said, they create a significant part of the core for PHP and make it open source and available for free, all of which is good. In a perfect world, this would be the perfect solution.

    However, it is right to be watchful (not necessarily concerned) when the core of an open-source app is created and driven by a for-profit company. Since they sell a lot of surrounding support applications to make their money, they are clearly driven at some level to pay for that development. At the very least, it means that any really good idea that they have will get turned into a commercial product instead of rolled into an open source solution. Again, perfectly fine business model, but not awesome.

    The other thing it does is that there is a subtle but probably powerful pressure pushing other developers working in the PHP space to consider not working there, because they will by definition start out behind this core company. It wouldn't hold off a determined company, but if a determined company began to come into the mix, it would be surprising if the core company didn't somehow use the fact that they are so essential to their advantage somehow. Without competition they can be magnanimous, but with it much less so.

    At any rate, I'm just pointing out that there's reason to keep an eye on it, even if nothing ever comes of it. It's also important to encourage more businesses to adopt this model so something as good as this can come along, and it's important for them to be watched by others to make sure they don't abuse it. The lessons of Microsoft, although in a different league entirely, are too strong to ignore.

  29. Why Perl is still the Regex king by einhverfr · · Score: 4, Insightful

    First of all having PCRE support and having regular expressions heavily integrated into the language the way Perl does are completely different things. So when I need to do log parsing, I do it in Perl, not Python, not PHP. It is simply easier and things fit more nicely for me (I use Python and PHP for at least as much development as I do Perl, but Perl still has its uses).

    Second Perl has some nice features that PHP and Python lack. Of course PHP has some nice features that Perl and Python lack, and Python has some nice features that..... You get the point.

    Even Javascript has some nice features if you are scripting other components (i.e. in a XUL application) but the next time I ask someone how to itterate through a hash table in Javascript, they had better not say "you don't..."

    --

    LedgerSMB: Open source Accounting/ERP
    1. Re:Why Perl is still the Regex king by AstroDrabb · · Score: 2, Insightful

      Ruby? Ruby? Do you know why I haven't spent the time to learn Ruby? Because I have learned too many dang language. C, C++, Java, Perl, PHP, Python, C#, VB, Bash, SQL, PL/SQL, not to mention all the other stuff like JavaScript, HTML, etc. Does Ruby offer anything that all of these language together do not? If so, maybe I will get off my butt and give Ruby a whirl.

      --
      If Tyranny and Oppression come to this land,
      it will be in the guise of fighting a foreign enemy. -James Madison
    2. Re:Why Perl is still the Regex king by Anonymous Coward · · Score: 5, Interesting

      Ruby is basically a superset of Python and Perl.

      If you've ever been programming Python and wished it was cleaner and less "arbitrarily verbose", you'd like Ruby. If you wonder why Python arbitrarily makes you say "len(str)" instead of "str.len()", you'll like Ruby. If you wonder why Python makes you type "def foo(self)" instead of just "def foo", you'll like Ruby. If you wonder why you should type verbose hard-to-read stuff like "[f for f in n if f < 4]" instead of something like "n.each { |f| f<4 }", the give Ruby a whirl.

      If you ever programmed Perl and wished it had an actual object model, so you don't have to do stuff like "UNIVERSAL::isa($val, 'FooClass')", but can just treat each variable the exact same way like "foo.kind_of? Integer" you'll like Ruby. If you hate how Perl lets you make objects that are hashrefs OR arrayrefs OR scalarrefs, making extension of existing classes utter madness, you'll like Ruby.

      If you like adding your own methods to base types like Arrays, Hashes, Integers, etc., you'll just go nuts with Ruby.

      If you like distributed programming you'll get a kick out of DRb (comes with Ruby).

      Do you need extended your languages with external C libraries? You will positively, absolutely shit yourself three times when you try out Ruby/DL, which lets you extend Ruby with arbitrary C libraries at run time without any compiling or setup.

      If you wonder why Java takes 3-5 lines of code just to parse an XML file or set up a loop you will find Ruby quite a change. And REXML is the most lightweight easy to use XML parser I've ever used (PHP5's new parser comes *close*.. but PHP is not Ruby).

      If you like writing code FAST without worrying about heavy syntax or arbitrary design choices, you'll like Ruby. If you like passing anonymous code blocks to your functions like SmallTalk, you'll get a kick out of Ruby (and if you don't do that, learn, it will make your programs tighter). If you are into agile programming and merciless refactoring, you'll like Ruby (unless you are a lover of lisp macros, then you'll find Ruby blocks a little limiting, can't help you there).

      If you use a Mac you'll like it because Ruby is pre-installed.

      If you do MVC-type web apps, your mouth will hang open when you use the highly dynamic Ruby on Rails (how do you add a new object to your app when you add a new database table? ONE LINE OF CODE. How do you add a new field to your object when you add a new column to the database? DO NOTHING.)

      Ruby is the only language I can say with a straight face is "beautiful" AND useful.

      So unlearn a couple of those languages and try Ruby! ;-)

    3. Re:Why Perl is still the Regex king by wtd · · Score: 5, Informative

      The only thing I would add is that Mac OS X users should install Ruby themselvesbefore making any judgements on it. The version shipped with Panther is a bit dated, and if I recall correctly lacks some of the features you get from installing it yourself.

    4. Re:Why Perl is still the Regex king by fucksl4shd0t · · Score: 2, Insightful

      If you know all those other languages, you probably don't need much to learn one more. Come on! The first one's tricky, the second one's annoying, all the rest are easy.

      Hell, I can't remember the last time it took me more than 15 minutes before I could code a new language (and I'm not talking 'hello, world' either).

      Wait a minute, you count VB, Bash, and SQL as programming? Maybe that explains it all. Some of us consider those UI.

      --
      Like what I said? You might like my music
    5. Re:Why Perl is still the Regex king by Anonymous Coward · · Score: 2, Interesting

      If you need decent Unicode support, don't try Ruby, 'cos it's author arbitrarily dislikes Unicode and refuses to implement it. Hint: you probably either do need it or will do soon.

      If you want your programs to run at a decent speed, don't try Ruby, because for the amount of money you'd have to spend on hardware fast enough to run Ruby at anything above a toe-curling crawl, you could afford to hire so many extra programmers that they could write your code in hand-tuned ASM just as quickly as you can write it now in PHP.

      At this point I'm supposed to round out the post by recommending Lisp or Smalltalk over their bastard offspring, but I can't be bothered.

  30. Re:Compatible? by Jellybob · · Score: 2, Informative

    In almost all cases PHP4 code will run fine under PHP5.

    The only situations where you're likely to hit problems are in reassigning $this in OO code, for example if you had constructors which would go

    $this = new My_Error_Class();

    Which is no longer supported.

  31. Unicode Any Better? by ThatDamnMurphyGuy · · Score: 2, Interesting

    PHP is dead. Long live PHP!

    Now that I have that out of my system. Does anyone know if PHP5 Unicode is any better than PHP4?

    Admittedly I've done about 10 total minutes of PHP coding in my entire life, but I do follow it as closely as possible when I'm not thinking about Perl. I always got the impression the Unicode working in PHP4 was a little lacking compared to the latter versions of Perl.

    For example: PHP does have limited unicode support and Joel on Software.

  32. Re:Am I the only one... by ShadeARG · · Score: 2, Interesting
    The products they produce to support the development of php the closed source.
    This is part of the problem. While this isn't in itself a terrible practice, it does leave esoteric developers who prefer other different architectures out in the cold.
    There is nothing wrong with this business model, get over it.
    Exactly. It's not that we always want free beer, we just like to make sure that we can drink as much as everyone else. Now, if you could request a cross-compilation for a different architecture at no additional cost with the license, then we'd all be impressed.
  33. OS X? by HitByASquirrel · · Score: 2, Informative

    I guess those of us who do not know how to make our own binaries just have to wait for Marc Liyanage to port this thing.

    thanks Marc.

    I cant wait to play with the final XML/DOM-3 libs.

  34. I hate to say it.... by Anonymous Coward · · Score: 3, Informative

    ...but Microsoft really did get there lightyears ahead of this, with a far more complete class library and a standardized language, as well as a scripting engine that supported true seperation of code, presentation and so forth.

    Just to clarify this, consider the following:- ASP.net's been precompiled since the 2000 beta, and it's been production ready for years. The C# language is also fully documented and is a public standard ratified by the EMCA.

    PHP5, however nice, is treading old water, and in terms of functionality is still lagging behind even Java/JSP. The whole reason I'm assuming people stuck with PHP4, rather than move to something more robust that provides this kind of capability, is that:-

    1) They're apathetic about new technology.
    2) If the old language does what they want, why upgrade. It's *Personal* Home Page, after all, not corporate homepage.
    3) Why make things more complex, for very little benifit.

    Performance wise, the compiled version advantages are fairly insubstantial, and 99.9% of the new stuff they've added could have been done in other ways using the existing language.

    The whole thing seems pretty stagnant, and I'm guessing there's a small chance that the PHP guys are stuggling to find their own space between the land of true pre-compiled OO languages and the interperated world that lay behind it.

    I've worked with PHP4 and ASP.net since both of them were betas, and if PHP wants to be a serious consideration for large scale development, it'd better decide which side of the OO fence its on, and stay there.

    1. Re:I hate to say it.... by a_karbon_devel_005 · · Score: 2, Informative

      Just to clarify this, consider the following:- ASP.net's been precompiled since the 2000 beta, and it's been production ready for years. The C# language is also fully documented and is a public standard ratified by the EMCA.

      ASP.NET is a completely different class of thing. Of course it's been pre-compiled, because just like the other .NET languages, it gets turned in to MS's CLR, which is of course a byte-soup. PHP is not compiled at all, which makes it more flexible to develop... no compile time, just write-test-write-test-write-test ad nauseum.

      There's no real advantage in compiling most PHP code because the life cycle of a script is so short, compiling really wouldn't make much difference. If you're going to be doing so much processing with a script that it requires compiling most people have either:

      1) written the script in another language
      2) compiled some C code and then exposed it to the PHP interpreter (using swig or somesuch).

      But the issue doesn't come up that often because if you're writing things well, php is usually fast enough.

      The whole thing seems pretty stagnant, and I'm guessing there's a small chance that the PHP guys are stuggling to find their own space between the land of true pre-compiled OO languages and the interperated world that lay behind it.

      Stagnant? Have you seen the RAW amount of libraries available for PHP? Have you seen the language changes that have been going on for 5? Obviously not. You're spewing marketing BS with no knowledge.

      1) Modules are constantly written for PHP because it's such a simple language to extend.
      2) The changes in 5 are very significant for those who actually have to USE PHP, and that should be apparent to ANYONE who takes time to read the changelog.


      I don't know where you come up with "stagnant" other than what it "feels like" to you.

      PHP5, however nice, is treading old water, and in terms of functionality is still lagging behind even Java/JSP.

      Examples Mr. ASP? Sounds like more marketing style bs. Post some examples. ( and watch them be refuted in no time flat )

      I've worked with PHP4 and ASP.net since both of them were betas, and if PHP wants to be a serious consideration for large scale development, it'd better decide which side of the OO fence its on, and stay there.

      1) Why the fuck work with ASP.NET when C# is out there?
      2) As much smarter people out there have commented, there is not necessarily a correlation between OO and "scaleability".

      ...but Microsoft really did get there lightyears ahead of this, with a far more complete class library

      Just because PHP doesn't have a large "class library" doesn't mean that it's immense functional library is irrelevant. Far from it.

      The whole reason I'm assuming people stuck with PHP4, rather than move to something more robust that provides this kind of capability, is that:

      Care to mention WHAT kind of capabilities you're talking about?

      Personally I think PHP is good for a great many things, though I like other languages like Python, C#, C++, and Java better for my own stuff. Why don't you post some specific examples though instead of just getting a woody for ASP.NET?

    2. Re:I hate to say it.... by Synn · · Score: 2, Informative

      1) They're apathetic about new technology.
      2) If the old language does what they want, why upgrade. It's *Personal* Home Page, after all, not corporate homepage.
      3) Why make things more complex, for very little benifit.


      You forgot:

      4) Because it works.

      I've been the admin for Apache/PHP servers for close to 6 years now and I've not ever had PHP cause a single crash. You can have complete idiots writing PHP scripts and you don't have to worry about them taking down you're entire server with a bad piece of code.

      The truth of the matter is that people like me don't care which side of the OO fence PHP is on, we just want something that works and we don't want to get phone calls on our off hours about something crashing. PHP is a solid solution for that.

  35. Can this be a JIT compiler? by Theovon · · Score: 2, Interesting

    This makes me wonder if the PHP programs have to be manually compiled, if they can be compiled JIT, or if a compiled version can be cached and only recompiled if the original PHP source changes....

  36. Re:PHP - ASP Showdown by mabinogi · · Score: 3, Insightful

    Ok, apart from the fact that you're obviously trolling, I don't really have a comment on most of your points as I've never used ASP, and I've used PHP enough to know that I hate it and everything it stands for, but I still have to question at least one of your points - "ASP includes database connection pooling, something that costs many thousands of dollars on Unix"

    That sounds like you're quoting a marketing guy with no idea what you're talking about.
    Sure, ASP may contain DB connection pooling, and sure, PHP may not have it, but "Costs many thousands of dollars on Unix" is the most ridiculous thing I've ever heard.

    Show me this many thousands of dollars worth of "Database Connection Pooling On Unix".

    Unix has nothing whatsoever to do with it. PHP runs in IIS quite nicely. And even if PHP was a Unix specific thing, there's nothing hard or expensive about connection pooling, and there are free libraries implementing it in just about any language that can access a database.

    --
    Advanced users are users too!
  37. Don't you mean "Goodbye PHP"? by markv242 · · Score: 3, Interesting
    Seriously, I'm looking at http://www.php.net/zend-engine-2.php and all that the eye can see is a nearly-identical syntax to Java. Classes, object cloning, Throwables, destructors, exceptions (albeit weak ones), statics... holy crap people, why not just switch to Java? It's all that PHP5 has and more.

    (Hurray for being modded as flamebait!)

    1. Re:Don't you mean "Goodbye PHP"? by base_chakra · · Score: 2, Informative

      why not just switch to Java? It's all that PHP5 has and more.

      Except for speed. :)

  38. PHP is powerful, but weak in some aspects by apia · · Score: 2, Informative
    I use PHP to develop a p2p application (CLI mode), the project name is called "apia", I develop it for more than two years.

    In my experience, the memory management in PHP is not good. Coding should be very careful, or the memory will be usually exhausted.

    Another problem is the speed. Well, it is inevitable that interpreter execution is slow. However, I think PHP can run at least twice than current version if the inner architecture of PHP could be carefully rewritten.

    Additional, I hope PHP could be multithreaded. When develop a serious application, multithreading or multitask can help programmer lots. And also the efficiency of application could be higher.

    I hope these problems could be solved in PHP 5 or later versions.

    If you are interested in apia, check : http://clonefab.net/, but there is no English web site yet, sorry for this. It is developed in Chinese language initially. The English document will be ready ASAP. As for apia package itself already support english. You can download it in : http://clonefab.net/apiaDownload.php

  39. Re:Am I the only one... by bobsledbob · · Score: 2, Interesting

    With your reasoning, there's reasons to be concerned about every open source software except those created in the basements of college dorms.

    Frankly, I don't disagree with you. You should be mindful of every piece of software you use, open or otherwise. But, your argument seems more about Karma Whoring than it does a real concern.

    I mean, seriously, what about the Apache Foundation? Where do you think they get their money from? Corporations using their products, right? Don't think they're influenced by said corporations?

    I frankly an very supportive of the Zend model of creating a business around open source. It's very pioneering, they've done a good job. I've used php since the PHP/FI (v2) iterations, and I'm still happy to continue using it.

    --
    Beware of geeks bearing formulas.
  40. Parens don't turn everybody off by brlewis · · Score: 2, Informative

    A lot of folks have no problem migrating from f(a, b) to (f a b). In fact, a lot of people don't find the migration from 2+2 to (+ 2 2) all that hard. I use Scheme all the time and like it.

  41. Thread Safe yet? by bmzf · · Score: 2, Interesting

    Is php 5 thread safe? More specifically, is it safe to use in a production environment with Apache 2?

    1. Re:Thread Safe yet? by andig · · Score: 5, Informative

      The problem isn't the core of PHP, but the dozens of PHP extensions and third-party libraries they use. Even if a library claims thread-safety, it is not always so. Therefore, we (as in the PHP development team) recommend to use PHP with the pre-fork MPM of Apache 2 or with Apache 1.3.

  42. SOAP by Tobias+Luetke · · Score: 2, Interesting

    Its definatly an awesome release. I'm thrilled by the native SOAP support.
    Hard to imagine what the OS crowd will do with a blockbuster feature like this generally available. SQLite will improve the xcopy deployment compatibilities of simpler apps and SimpleXML is the best xml API i have seen so far in any language. On the OOP front we get exceptions which will finally unmangle the error systems of most complex php web apps which usually accounted for a big chunk of the code.

    Anyways, php is cutting edge again.

  43. Re:Woohoo! Now only 3 years out of date! by rycamor · · Score: 2, Insightful

    As a long-time PHP developer, I have to agree with you somewhat. PHP5--Woohoo!! Ohh, wait... No namespace support? (Arggh... of all features to leave out...)

    All the new features are sort of the stuff you would call a 'given' for object-oriented programming. Nice to have, but nothing to get really excited about.

    Really the things that I found more interesting about PHP were all the system-oriented capabilities developed from version 4.3 onward, such as streams, sockets, direct I/O, etc... Of course, all these are givens in some languages too ;), but at least PHP puts them all together easily at your fingertips.

    The other cool things about PHP are the really dynamic things you can't do in Java, such as variable variables ($$varname), variable function calls ($function_name()), and the extended features for variable interpolation in strings. Also, features like array_map, create_function, and the overload extension are quite cool.

    But yes, it looks like Perl 6 is going to up the ante big-time. Interesting to see where PHP goes in the interim, though.

  44. Perl2Exe, PAR... Perl rocks.. by keepper · · Score: 2, Insightful


    I see so many posts about how this would make them switch from perl to php.. but perl has had this for ages...



    http://www.indigostar.com/perl2exe.htm

    http://par.perl.org/

    HEH!!!
    1. Re:Perl2Exe, PAR... Perl rocks.. by juhaz · · Score: 2, Informative

      No, perh has not had it, and still does not.

      Those are not compilers, they just bundle the interpreter and needed libraries into package.

  45. This could be so exciting... by FoboldFKY · · Score: 5, Interesting

    ...but for some reason I'm rather disinterested.

    Don't get me wrong; I've been doing PHP coding for a while. But the fact of the matter is that the more I code in PHP, the more I dislike it.

    Granted, the new OOP features in PHP5 are a good thing; hell, they should've been in there a LONG time ago. And exception support has me jumping for joy.

    But where for the love of all that is holy is support for namespaces? I mean, sure PHP has a ton of really handy extensions, but I am getting so sick to death with typing underscores that I'll be happy man if the world suddenly decided that underscores were bad and removed them from all character sets (oh, and keyboards) entirely.

    And I've also come to the conclusion that the standard PHP api can't quite make up it's mind whether it's supposed to be emulating C, or maybe some other language. Some array functions are prefixed by array_. Some aren't. Some have their arguments in the reverse order that almost all the others do. It's a mess.

    PHP is a nice language, good for beginners. But it's complete lack of namespaces, half-arsed support for functional constructs (damn I hate having to write callback functions out seperately when they're one liners!), and schizophrenic api are slowly pushing me towards more well thought-out languages like Python.

    Sure, Python's "thou shalt indent" system annoys me a lot of the time, but other then that it's just a clean, logical language. Unfortunetly, support for it on web hosts seems to be all but non-existant.

    Seriously, if the PHP devs really want to bring PHP up a few notches, they need namespaces, and to standardize the API naming conventions. I shouldn't have to constantly open up the PHP manual to work out whether the array sorting function has array_ out the front or not.

    Still, it's a nice set of improvements, so credit where credit is due. Kudos to the PHP team.

    --
    We're geeks... We're the sorcerers of the modern-day world. --
  46. Re:Compatible? by Trifthen · · Score: 4, Informative

    Uh... no. They also changed the object inheritance rules so that overloaded child methods have to have the exact same number of parameters as the original class. So, now you can't have multiple constructors *or* have child constructors that assume certain values and reduce the amount of paramters accordingly.

    Yuck.

    As a person who codes entire 20,000+ line application libraries in PHP and has been watching the development of PHP 5 very closely, there are a lot of decisions the PHP developers have made that make me very hesitant about going anywhere near the new PHP version.

    As an aside, the PHP developers have decided to make SQLite, a light file-based database engine, the default session handler. Even with all file locking turned off, this is at least 4 times slower than the current system used by PHP 4. Of course you can change this setting back to flat session files, but the fact this is their default should say something about other decisions they've made. This setting itself makes especially no sense to me, as all session variables go into the $_SESSION superglobal as associative array keys - there is absolutely no benefit to using a database-enabled flat file for this, as opposed to a regular flat file. It's as if the PHP group were excited about sqlite and tried shoving it into everything.

    Just read the changelog very carefully. If you're already using PHP, and have gone deeper than casual use, your applications *will* break - especially if you turn on PHP's strict mode which kills backwards compatibility with PHP 4.

    --
    Read: Rabbit Rue - Free serial nove
  47. PHP and Unicode by UnConeD · · Score: 3, Informative

    The basic summary is, PHP does not support Unicode or any other encodings properly. PHP strings are 8-bit-per-character and do not have any explicit encoding. Sure, there is a multibyte string extension available, but when you look at the big picture, it's worthless.

    The reason is that PHP's biggest strength is that these days, you can get a PHP-enabled host for virtually no money. However, most of these installs run a standard PHP, some even a locked down one.

    The consequence is that anyone who wants to develop PHP software for a large audience cannot use any non-standard stuff (except /maybe/ the popular graphical extensions like GDlib). Which means that for those developers, PHP does not do Unicode at all.

    I don't see why they won't do native Unicode, when Perl, Python, Java and all the other popular web languages support Unicode with all the bells and whistles.

  48. dynamic languages by dekeji · · Score: 2, Interesting

    Benchmarks say that performance is pretty good. Is this another sign that dynamic languages are the future?"

    No more and no less so than they have ever been: dynamic languages are a good choice for many, but not all applications. And dynamic languages have been enormously popular for decades, with far programmers using them than using static languages; PHP just follows in that tradition.

    What is more interesting is the emergence of dynamic languages which use static type systems by default: in their runtimes, Java and C# have more complete and better defined dynamic features than Lisp, but they still give the user a simple static type system by default. It remains to be seen whether that gives you the best of both worlds or the worst. Fortunately, their runtimes are well-defined enough that one isn't limited to the specific choices that the currently popular languages running on top of them have made.

  49. More proof . . . by peachpuff · · Score: 2, Insightful
    . . . that it's mostly in the eye of the beholder:
    If you wonder why you should type verbose hard-to-read stuff like "[f for f in n if f < 4]" instead of something like "n.each { |f| f<4 }", the give Ruby a whirl.
    --
    -- . . ramblin' . . .
  50. Alternatives to compiling Perl to native code? by dotnetwolf2003 · · Score: 2, Interesting

    Lucky PHP guys.. Too bad that support for compiling Perl code into executables is almost non-working.. The only viable alternative I know of is using Stunnix Perl-Obfus for obfuscation/scrambling, and turning output into executable with PAR or Perl2Exe. Does anybody knows a better alternative?

  51. Re:How do they know it uses Bigloo Scheme? by Habbie · · Score: 2, Informative

    $ rpm -qlp roadsend-pcc-prereqs-beta2-1.i386.rpm | grep bigloo
    /usr/bin/bigloo
    /usr/lib/bigloo
    /usr/lib /bigloo/2.6c
    /usr/lib/bigloo/2.6c/bigloo.h
    /usr/ lib/bigloo/2.6c/bigloo.heap
    /usr/lib/bigloo/2.6c/ bigloo_config.h
    <snip>
    /usr/lib/libbigloo_s-2.6c .so
    /usr/lib/libbigloo_u-2.6c.so
    /usr/lib/libbig loofth_s-2.6c.so
    /usr/lib/libbigloofth_u-2.6c.so
    /usr/lib/libbigloogc-2.6c.so
    /usr/lib/libbigloog c_fth-2.6c.so

  52. No it wasn't... by Phil+John · · Score: 2, Informative

    ...Dmitri who wrote Turck mmcache was offered a job at Zend and, shock horror, took it. However, as mmcache is GPL'd it lives on at sourceforge, with a new cvs commiter appointed (IIRC) and dev work continuing. To be honest though, it's pretty much feature complete so all they need to do is sure up support for PHP5 (still beta at the moment).

    --
    I am NaN
  53. wrong by solidox · · Score: 4, Informative

    i'm not quite sure where you're getting this from.
    i've been using php5 since the first beta and afaik it has never required overloaded child methods to require the same number of arguments as the parent class.

    <?
    error_reporting(E_ALL|E_STRICT);
    class SomeParent
    {
    function __construct($var1, $var2)
    {
    echo "Parent: $var1, $var2\n";
    }
    }
    class SomeChild extends SomeParent
    {
    function __construct($var1,$var2,$var3)
    {
    echo "Child: $var1, $var2, $var3\n";
    }
    }
    $x = new SomeParent(1,2);
    $y = new SomeChild(3,4,5);
    $z = new SomeParent(6,7,8); /* outputs:
    Parent: 1, 2
    Child: 3, 4, 5
    Parent: 6, 7
    */
    ?>

    as for sqlite as session handler, it is not the default, nor has it ever been the default.
    there was a patch to ALLOW it to be used as a session handler, by setting session.save_handler = sqlite in php.ini
    but if we look at the php.inis in the php5 distribution:
    [solidox@server150 php-5.0.0]$ cat php.ini-*|grep "session.save_handler"
    session.save_handler = files
    session.save_handler = files

    both dist and recommended use flat files as the default session handler.

    --
  54. debugging by mgkimsal2 · · Score: 2, Interesting

    If memory serves, PHP3 had built-in debugging output capabilities. When Zend became 'official' and PHP4 was released, debugging was suddenly nowhere to be found. BUT, lo and behold, you can get debugging capabilities if you purchase the Zend Studio and server extensions. Yes, there are open source debugging extensions now too, but that move was the one that made me start thinking like you're doing. Again, nothing inherently WRONG with it, but it was something that seemed to be held out of the core system to help fund the development by selling it separately.

  55. Some small questions... by WWWWolf · · Score: 2, Interesting

    Have they fixed the most annoying thing about PHP4? Specifically, if I put <?xml version="1.0" encoding="iso-8859-1"?> quite normally outside of PHP code, PHP4 barfs. (Which is quite annoying if the recommended way to put PHP code in is to use <?php ... ?<, specifically for XML/XHTML compliance. A savage hypocrisy.) And before you ask, no, I can't mess around with PHP configuration or anything.

    Also, what about componentization? Any news on that front? I'm quite fond of Perl's HTML::Mason and sort of like JSP tag library ideas - can I clearly separate the code and the page, or do I still need to mess them together?

    News of a new XML parser sound good, though. PHP4's idea of XML parsing is... ugly. =)

  56. my experience with php by scrytch · · Score: 3, Interesting

    I remember putting a CMS together with PHP4, something like Midgard, but pure PHP with multiple backends. It's not entirely a bad design even now, though I think Zope has a better answer.

    I ran into some awesomely dumb stuff. I mean "what are they smoking" stuff.

    Brain dead parser: First of all, this requirement to put everything in tags or whatever brackets you have defined. What is this, javascript? (and even javascript doesn't need it if you use src="foo.js"). That alone, not so bad, but the parser would easily choke on any end bracket construct ANYWHERE -- in a string, in a comment, etc.

    Flat namespace. OOP completely unused in extensions. Since PHP can easily call functions dynamically by name, and we have PEAR now, I consider the problem solved. No worse a hack than perl's OOP implementation, really. But I had other problems with OOP...

    Pass-by-value: PHP4 would pass objects by value. Which is actually great if I want such value-type, but 99.9% of the time, I don't. What made matters worse was PHP's twisted notion of object identity -- it had no operator to test it. Equality comparison operators were always by value, and either "shallow" or "deep". I had to explain the concept of object identity, and for my trouble, got the '===' operator ... which did exactly the WRONG thing and implemented even DEEPER comparison. That was the point where I went over the edge and wrote off PHP. I hear this behavior has mercifully changed to a sane one in PHP5.

    Second-class-language attitude: I got choice responses from Zeev himself about how PHP is never intended to be more than a "web language" (apparently meaning limited to trivial scripting, because the web apps I use sure aren't trivial). PHP can be and has been used for powerful things, but I don't see writing a caching bulk DNS lookup service that tests against multiple RBL's using PHP if I can't get a serious contender to Net::DNS because PHP is "merely a web language" after all. I used Perl for that, then switched it to Python (stackless was ideal for this job) and then dropped it into the object publisher in mod_python. Painless. There is no such thing as a "web language", behind every web app there should be a *real* language.

    Error handling: Nonexistent. Got an error, it would print a traceback to the output if you were lucky. Syntax errors would simply die without any useful diagnostic. No eval (well there is, but it would also just die on syntax errors). I've seen structured exceptions in C, but PHP's was awful. Awesomely brittle.

    Hopefully PHP5 is migrating most of these warts away from PHP4. Perl certainly still has its own problems (mod_perl 2.0 is still not in a stable release state) so it's not too late for PHP among current perl users.

    --
    I've finally had it: until slashdot gets article moderation, I am not coming back.