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

19 of 524 comments (clear)

  1. 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: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.

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

  4. 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.
  5. 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...

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

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

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

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

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

  12. 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.
  13. 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.

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

  15. 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! ;-)

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