Posted by
CmdrTaco
on from the get-your-develop-on dept.
An anonymous reader writes "PHP just released the first release candidate of PHP 5 after 4 beta releases. It is considered stable and feature-complete -- so get testing!"
Re:Power Power Power
by
Anonymous Coward
·
· Score: 5, Insightful
It's funny, I remember when it was a main tenet of programming that data should be separate from presentation. However, PHP has shown just how powerful integrating data and presentation can be through inlining code directly into a webpage layout.
Try something complicated. You'll change your tune right quick.
Re:Time for /. to
by
Sheetrock
·
· Score: 5, Interesting
Although you might be kidding (since/. has an established base of well-tweaked high quality/high performance Perl code), not only is PHP and in particular PHP5 is an excellent choice for prototyping because of the integration between display and function, but it's probably the right choice most of the time for people who are seeking to integrate databases with web functionality without delving into high-priced solutions.
/. is in a special situation due to the amount of traffic it receives, and the amount of effort that has gone into making Slash the powerhouse that it is has no doubt driven projects like perl_mod to increase the efficiency on the webserver side. While PHP would only improve on the appearance and capability to add user functionality, there would be issues with stability.
--
Try not. Do or do not, there is no try. -- Dr. Spock, stardate 2822-3.
Re:Power Power Power
by
Anonymous Coward
·
· Score: 4, Insightful
Powerful is one thing, maintainable another.
Keeping data and presentation separate is still the best thing to do. But that's why we have CSS. So unless you're still using tables, font tags or whatnot, you're not integrating data and presentation.
significant changes
by
berkleyidiot
·
· Score: 5, Informative
be careful upgrading, as the semantics regarding object assignment have changed from copy to reference. i know some of my code would make use of the old copy-on-assignment semantics.
other than that, looks like version 5 introduces some cool stuff, ala java. abstract classes, exceptions, method visibility, and interfaces to name a few. can't wait to give it a try.
Re:significant changes
by
Carl+T
·
· Score: 5, Insightful
the semantics regarding object assignment have changed from copy to reference
Sounds to me like the migration to PHP 5 will be a long and painful one. The project I've been working on in PHP for the last couple of years sure could use some of the new features, and if what another poster said about responsiveness translates to higher speed, that's another reason to switch. Then again, looking through megs of PHP code for things that are suddenly ever so slightly broken because of subtle language changes is not exactly fun.
For new projects, OTOH, I don't see much reason to stick with PHP 4, except the horrors of having to instruct users that they need to upgrade their PHP interpreter(s) again.
--
This signature is not in the public domain.
Re:significant changes
by
T3kno
·
· Score: 4, Informative
All of the XML stuff has changed as well, I found that out while going through the Core PHP, which has been *cough* updated *cough* to cover PHP5. They forgot to mention that they were talking August 2003 PHP5, AKA PHP5 before libxml2.
The nice thing is that it nearly completely models the functions listed in the w3c recomendation for the DOM Level 3 Core, which are also nearly identical to the XML::LibXML module in Perl.
So, IHMO PHP5 = Good, Core PHP 3ed = Bad!
-- (B) + (D) + (B) + (D) = (K) + (&)
Damn, you're clueless
by
jbellis
·
· Score: 5, Interesting
- for all but the most trivial sites, separating code & presentation is a Good Thing - PHP supports this kind of separation. google for template libraries.
Re:Power Power Power [where's my perl!?!]
by
Telastyn
·
· Score: 5, Insightful
Huh?
Having been a big PHP fan, let me assure you that PHP has a strong central theme like a kleptomaniac with ADD has a strong attention span.
Having been a big PHP fan, every story about PHP releases reminds me of the page long list of vulnerabilities and issues under it's entry in netbsd's package listing.
Having since moved to perl, I'm wondering if those death throes you're talking about are the same ones that haven't arrived on my BSD machine yet...
Re:Power Power Power
by
kevin_conaway
·
· Score: 4, Insightful
Umm, Perl is not dead or dying. It may not be used as much as it used to for CGI programming but in the world of system administrators, it is still very much alive and even growing. An admin without perl is making his or her life much worse than it could be
Re:PHP in comparision to others
by
Charles+Dart
·
· Score: 4, Informative
PHP is very fast and easy to use. The php.net website has great documentation. With the PEAR extension database abstraction is possible making all your data functions totally portable. As for quick hacks php can be run on the command line which is very quick and very hackey. I have been using it for years in tandem with MySQL and find that it meets all my needs (except for the fact that MySQL doesn't have nested queries but that is coming in the next release and I will be a happy man!) I also know JSP and Oracle but prefer PHP/MySQL by far.
Apache 2.x safe to use yet?
by
Anonymous Coward
·
· Score: 5, Interesting
I remember reading within the PHP docs about how unsafe it was to use the 2.x release branch of Apache with PHP...something to do with thread safety if I recall.
Anybody know if PHP 5.x has overcome this limitation?
Re:Apache 2.x safe to use yet?
by
shiflett
·
· Score: 4, Informative
You have to use the pre-fork MPM, which is the same condition you'll have when using various modules with mod_perl. Basically, PHP core is thread-safe, but you're likely to use some extensions in your own configuration, and these aren't necessarily thread-safe.
I'm not aware of a list of "who's safe", but such a thing would be nice.
PHP is a weakly-typed language by design, not because they haven't gotten around to implementing type checking yet. If you're feeling insecure about your code, you can always explicitly typecast your variables or use the settype function to calm your nerves.
I've been using PHP extensively for years now and I can't say I've ever run into a problem with its handling of data types. Let's not forget that PHP is, after all, a scripting language.
Re:Power Power Power
by
justMichael
·
· Score: 4, Informative
Do yourself a favor and do not mix business and presentation...
Somewhere down the line you are going to have a person working on design that doesn't understand PHP and breaks something. Then you can either spend who knows how long to figure out what is broken or throw out their work and just roll back to what's under revision control (you use revision control, right?). Either way you wasted time. Or worst case, nobody notices the logic is broken and it makes it to production.
Go find a template engine that you like and use it. You'll be happy in the long run.
Speed: they're all "fast enough." All of these scale well enough that for most sites you won't care, and none of them really scale well enough to support something like cnn.com. [Read through the archives to get a feel for the pain/. has to go through to serve its audience, for instance. And/. isn't even THAT big.] No flame; just that all these options are low/middle end.
Ease of use:
Classic ASP is pretty close to Perl. ASP.NET is a rather different paradigm, with a slightly steeper learning curve but more than enough added power to make it worthwhile. Unfortunately ASP.NET is a classic "leaky abstraction;" it tries to make things simple that sometimes aren't, and this will bite you.
Perl: it's nearly impossible to maintain a substantial site in perl with multiple developers working on the code. The language works against you here. Again,/. is a case in point. There's a reason/. doesn't upgrade to the latest & greatest very often.
JSP: takes a PHP-ish approach but Java is a statically typed language which makes using it for web apps _extremely_ verbose in comparison to the other languages here.
Javascript: poor fit for server-side use. Nobody does anything serious with it that way.
Verdict: They all suck to one degree or another. It's heresy on/. I know, but of these, ASP.NET is probably the best choice. If you want a toolkit/language that won't make site maintenance hell, OpenACS (tcl) or Zope (python) is probably a better bet. If you want something that will scale to absolutely huge levels (like the aforementioned CNN), J2EE is about the only game in town. (But a living hell to code for -- not recommended for smaller projects!)
Re:Here you go
by
flocculent
·
· Score: 5, Informative
While I agree with the rest of your comments it's not really true to say that ASP/PHP/etc won't scale to the size of a site like cnn.com. They may not always be your best choice of language, but they do fit certain niches rather well. In general, for a website to scale well, the overall system/software design is much more important than choice of language/environment. (Though it's true that j2ee app servers give you a big headstart here)
Whether a website will scale to cnn like levels is dependent on quite a few factors... two of the main ones that come to mind are:
a) How much work the site has to do to build a page (think basic marketing website vs an online banking site)
b) Sensible overall design (both code and network/hardware).
A well built PHP site (i.e many servers load balanced, well cached page content, intelligently coded to scale from the outset) will scale to whatever you like, at least for cnn type content which is easily cached.
I worked on one of the very few major news websites that coped with Sept11th traffic, and that website was developed using Linux/Apache/PHP/MySQL. (we only just coped mind you!;)
I remember reading a while back that yahoo use PHP for various bits and pieces too..
An article discussing some of the new PHP5 features.
Re:Power Power Power
by
loginx
·
· Score: 5, Informative
Whoever said that PHP only uses inline HTML for the presentation layer is a tool.
Thereareseveraltemplating enginesavailable that effectively separate the application layer and the presentation layer for PHP applications. These engines are quite heavily used also (check the source code of most large open source projects and commercial applications...)
Re:It is NOT stable
by
penguinblotter
·
· Score: 4, Funny
heh heh - you said "load"
-- Mind the gap
Control vs. Abstraction
by
Eberlin
·
· Score: 4, Interesting
Having browsed only a few ASP.NET howtos but not having had the opportunity (or misery -- since this IS slashdot) to code in it, I'm not too familiar with ASP.NET
OTOH, I am a bit more involved in programming in PHP. I think it's fairly nice and simple enough. Haven't gotten into a lot of the OO stuff but it's still fairly powerful with the simple things I do.
From what I've read, ASP.NET abstracts a LOT of the stuff from the programmer. Forms pretty much take care of themselves, validate on their own, and repopulate themselves for the user to correct. Among other things, this helps isolate code from content.
From experience (which may be very limited), PHP doesn't have this feature. This allows for so much more control over what happens to your forms, but also introduces more code into the mix which could get ugly after a while.
Thus we have control vs. abstraction -- a classic debate. Convenience and rapid development would lean towards abstraction (as anyone who coded VB may argue). Would be nice if PHP had that n00b convenience somewhere while still being great for more advanced coders.
Ultimately, control is probably the choice for anyone who wants to get past the abstraction. Besides, in the long run, you'd probably want to write your own data validation code (or at least implement an open-source version) instead of relying on a (closed-source) language to check for you. That's simply a matter of trust.
For people who think there must be something better to write web-based applications than PHP, I invite you all to take a look at Seaside by Avi Bryant, a web framework available for Squeak and, I think, VisualWorks Smalltalk. It uses continuations to make programming a web application basically the same as coding a desktop application. It features many, many things that PHP cannot do.
For those of you who don't know PHP, just wait a version or two. It already supports VB, C, C++, Javascript and Perl style coding. Version 5 is basically Java. Expect Intercal, Unlambda, and BrainF*** support by version 7 or 8. If you know a Turing-complete language, chances are you'll be able to use it to code PHP by the end of the decade.
PHP vs. Perl
by
transient
·
· Score: 4, Interesting
I swear I'm not trying to start a flamewar with this, so please respond appropriately.
What advantage does PHP have over Perl?
At first, I rejected PHP because of its (apparent) preference for intermingling presentation and logic. As has been thoroughly discussed in another thread, separating the two is not only possible but recommended. That doesn't give PHP any points though -- it just removes a penalty.
Both languages have a wide range of libraries/modules to choose from (although I think the score here goes to Perl). Their syntax is nearly identical. They both run on lots of different platforms. PHP is pegged as a tool for making web sites, while Perl is a general-purpose scripting language that happens to be useful for web sites too.
So, make a business case for me. I manage a development team (I rose from the ranks so save your MBA jokes for another day) and I want to know why I should consider PHP over Perl.
--
irb(main):001:0>
Re:PHP vs. Perl
by
claar
·
· Score: 4, Informative
Well, if you rose from the ranks, then you should be able to perform a simple test:
Think of a task that will take about 20 minutes to program
Program it in both Perl (use perldoc as another poster suggested) and PHP (use php.net/manual/en)
Wait 2 weeks
Attempt to add a simple feature to each script. Time yourself and compare
???
Profit!
When I go back and look at my Perl scripts I wrote a couple weeks ago, it takes me a while to get my head back into the script. With PHP, the code is always straight forward. It may be more verbose, but I understand it much more quickly than my Perl.
Besides this, I've found PHP's documentation to be far superior to any other languages'. When I do web programming, give me PHP anyday.
The only thing Perl has over PHP in my mind is that CPAN is currently far superior to PEAR. If you need many special libraries, you may want to consider Perl.
</ramble>
-- I'd give my right arm to be ambidextrous...
Re:Power Power Power
by
loginx
·
· Score: 4, Interesting
I personally use a proprietary templating engine, but if I was to use any of the open-sourced ones, I would first look at what my requirements are.
If you are looking for a full-fledged templating that has all the bells and whissles, I would recommend Smarty because it has a massive amount of feature and seems to be quite endorsed by official PHP developers.
If you are looking for something a little simpler to bring more speed and less overhead to your presentation layer, I do like the approach of the Sigma templating engine (in the links posted above) as it brings only what you really need and does it very quickly.
Did you test PHP5 or have a wine tasting?!
by
Anonymous Coward
·
· Score: 5, Funny
A test run of our PHP setup on PHP5 RC1 seems to be more responsive and crisp than it was on PHP4.
Riiight. "Crisp". Yeah, that sounds like a very analytical test run you did. Did you also notice PHP5's woody undertones and how it satisfies the spirit without weighing down the heart?
You got to be kidding. PHP has two primary strengths: architecture and standards. Java is a general purpose language build from the ground up as an OOP. Java is used from embedded systems, mobile phones, desktops, webapps to world class enterprise projects. Java has a sound definition as a language and its virtual machine. Java standards are defined by the JCP with formal methods for approving changes including Apache. AFAIK PHP is used only in webapps. OOP was added as an afterthought. PHP is a project of the Apache Software Foundation. Architecturally has native standard access to databases and there are drivers for every db, supports distributed transactions, has message queues, takes advantages of multiprocessors, JIT native compilers in the VM, libraries for every need. Don't know about PHP but for what I know Java has a more advanced architecture.
The majority of java webspace applications were written before css and xhtml were mainstream. What apps are you talking about? The PHP changelog shows that PHP 4.0 was released in may 2000. The great mayority Java webapps are based on servlet API 2.2 or later which where release on april 2000. Please explain how Java apps are less suportive of css and xhtml than PHP. BTW, how many PHP 3.x webapps are there?
I predict that there will be a need for css and xhtml conversions among the big java web apps and this will be readily delegated to PHP. If I would have a Java webapp that needs to support css and xhtml it would be ridiculous to rewrite the app in another language, when it could be easily adapted. How would I explain it to my customer? There's nothing in Java or PHP that prevents using css or xhtml or making them automatically supported.
I don't mean that PHP isn't useful, but Java has just a broader scope.
--
"I think this line is mostly filler"
Perl's grammar is too big
by
SnatMandu
·
· Score: 4, Interesting
PHP has a smaller syntactical (is that a word?) footprint. As you said that you manage a development team, this is important. The Perl motto of "There's more than one way to do it" becomes an issue when you've got multiple developers working on the same codebase. You can write and (attempt to) enforce code style rules in your organization, which mitigates this a little bit, but it takes time to write those guidelines, get buy-in, and enforce.
I use perl often, but I consider it a "fire and forget" language. I use it for sysAdmin type work often, when I'm doing something once, and want to write a quick script that nobody (including me) will ever lay eyes on again. For real development, where I'm trying to create a maintainable piece of software, with input from other developers, I stick to PHP.
Re:Perl's grammar is too big
by
SnatMandu
·
· Score: 4, Interesting
Most of your criticisms of PHP are totally on the money.
But come on. Once a programmer really gets into perl, only another hard-core perl person can read their scrawl. Don't get me wrong, I love perl. But it's a horrible choice for a large project with many developers.
I've not dug into perl documentation for a while (has it been years?), but last time I checked, it was about 100 man pages. With php, if I think there's a function called split, I type http://www.php.net/split and there's the docs.
Re: perldoc, c'mon! I get the impression you've never had to maintain code written by a hard-core perl programmer (or maybe you are one). For hobby stuff, use any language you want, but for business purposes, I don't want to have to search for developers who are so fucking specialized in perl. With PHP, I can make anybody who learned the basics fo C and make them productive in about 48 hours, working on someone else's code. With a big perl codebase, that same person is going to have to be twice as expensive if they're going to jump in head-first.
Re: too many overlapping core functions - I don't know what you're talking about. There are a few aliases in there (ie: chop or rtrim (which actually is annoying, since chop() should work like it does in perl, IMO)), but I don't see a lot of overlap.
I think perl is really neat, but it's overkill. I know that's the tried and true criticism, but I really think it's true. I don't want to give a group of 4-12 developers of varying cluefulness that sort of capacity to create havoc for each other.
Finally clause
by
BlueLabel
·
· Score: 4, Interesting
I used to be a PHP developer, but switched to python-based content management systems due to the elegance and ease of programming in python. However, I was interested to see how PHP had progressed since the last version, and read the article linked by Slashdot.
The main reason I initially dumped PHP was its atrocious error handling. Python and other more elegant languages use exception handling, which is much more elegant than checking return codes and setting error handlers.
I had read earlier than PHP 5 would include exception handling, but wouldn't include the "finally" clause. For programmers that understand and use exceptions, the finally clause is _very_ useful. I try to avoid using C++ simply because it doesn't have a finally clause (and no, the object destruction mechanism is not a good substitute).
So, I became very excited when I read the following:
Note that there is support for "catch all" and for the "finally" clause.
(http://www.php.net/zend-engine-2.php)
However, I couldn't find any examples showing the "finally" clause or the "catch all" clause in use.
So, I went grepping through CVS.
In the changelog for PHP, it is suggested that all exceptions _must_ inherit from a base 'Exception' class, which means that catching and exception of type 'Exception' is a basic "catch all". However, I couldn't find _any_ evidence in CVS that a "finally" clause has been introduced in PHP 5.
Has anyone here found evidence that the "finally" clause exists in PHP 5?
-- Devin
Connection pooling ?
by
vlad_petric
·
· Score: 4, Insightful
All the OO features are nice, but what's really missing in PHP are some critical "enteprise" features, like true connection pooling (and no, pconnect doesn't count).
--
The Raven
Stable my ass!
by
krumms
·
· Score: 4, Informative
I reported a showstopper bug two days ago that crashed Apache 2 hard.
It's been fixed now, but I don't see how they can go and say "Oh, it's really really getting there now" after bugs like that have been discovered so recently.
But PHP's development is odd to say the least. In the Betas alone, entire sections of functionality have been rewritten. From scratch. I mean, shit.
Don't get me wrong, PHP is a great language and PHP5 is a step in the right direction but the development of PHP seems, to me at least, so hell for leather.
It's funny, I remember when it was a main tenet of programming that data should be separate from presentation. However, PHP has shown just how powerful integrating data and presentation can be through inlining code directly into a webpage layout.
Try something complicated. You'll change your tune right quick.
move to PHP
Indefinitely Detained US Citizen
Powerful is one thing, maintainable another.
Keeping data and presentation separate is still the best thing to do. But that's why we have CSS. So unless you're still using tables, font tags or whatnot, you're not integrating data and presentation.
be careful upgrading, as the semantics regarding object assignment have changed from copy to reference. i know some of my code would make use of the old copy-on-assignment semantics.
other than that, looks like version 5 introduces some cool stuff, ala java. abstract classes, exceptions, method visibility, and interfaces to name a few. can't wait to give it a try.
- for all but the most trivial sites, separating code & presentation is a Good Thing
- PHP supports this kind of separation. google for template libraries.
Huh?
Having been a big PHP fan, let me assure you that PHP has a strong central theme like a kleptomaniac with ADD has a strong attention span.
Having been a big PHP fan, every story about PHP releases reminds me of the page long list of vulnerabilities and issues under it's entry in netbsd's package listing.
Having since moved to perl, I'm wondering if those death throes you're talking about are the same ones that haven't arrived on my BSD machine yet...
Umm, Perl is not dead or dying. It may not be used as much as it used to for CGI programming but in the world of system administrators, it is still very much alive and even growing. An admin without perl is making his or her life much worse than it could be
PHP is very fast and easy to use. The php.net website has great documentation. With the PEAR extension database abstraction is possible making all your data functions totally portable. As for quick hacks php can be run on the command line which is very quick and very hackey. I have been using it for years in tandem with MySQL and find that it meets all my needs (except for the fact that MySQL doesn't have nested queries but that is coming in the next release and I will be a happy man!) I also know JSP and Oracle but prefer PHP/MySQL by far.
I remember reading within the PHP docs about how unsafe it was to use the 2.x release branch of Apache with PHP...something to do with thread safety if I recall.
Anybody know if PHP 5.x has overcome this limitation?
It's in the design.
Yep. And if you inline presentation and data in a complicated web app, that's bad design.
I've been using PHP extensively for years now and I can't say I've ever run into a problem with its handling of data types. Let's not forget that PHP is, after all, a scripting language.
Do yourself a favor and do not mix business and presentation...
Somewhere down the line you are going to have a person working on design that doesn't understand PHP and breaks something. Then you can either spend who knows how long to figure out what is broken or throw out their work and just roll back to what's under revision control (you use revision control, right?). Either way you wasted time. Or worst case, nobody notices the logic is broken and it makes it to production.
Go find a template engine that you like and use it. You'll be happy in the long run.
Here's a couple to get you started.
PHPLib
Smarty
Speed: they're all "fast enough." All of these scale well enough that for most sites you won't care, and none of them really scale well enough to support something like cnn.com. [Read through the archives to get a feel for the pain /. has to go through to serve its audience, for instance. And /. isn't even THAT big.] No flame; just that all these options are low/middle end.
/. is a case in point. There's a reason /. doesn't upgrade to the latest & greatest very often.
/. I know, but of these, ASP.NET is probably the best choice. If you want a toolkit/language that won't make site maintenance hell, OpenACS (tcl) or Zope (python) is probably a better bet. If you want something that will scale to absolutely huge levels (like the aforementioned CNN), J2EE is about the only game in town. (But a living hell to code for -- not recommended for smaller projects!)
Ease of use:
Classic ASP is pretty close to Perl. ASP.NET is a rather different paradigm, with a slightly steeper learning curve but more than enough added power to make it worthwhile. Unfortunately ASP.NET is a classic "leaky abstraction;" it tries to make things simple that sometimes aren't, and this will bite you.
Perl: it's nearly impossible to maintain a substantial site in perl with multiple developers working on the code. The language works against you here. Again,
JSP: takes a PHP-ish approach but Java is a statically typed language which makes using it for web apps _extremely_ verbose in comparison to the other languages here.
Javascript: poor fit for server-side use. Nobody does anything serious with it that way.
Verdict: They all suck to one degree or another. It's heresy on
An article discussing some of the new PHP5 features.
Whoever said that PHP only uses inline HTML for the presentation layer is a tool.
There are several templating
engines available that effectively separate the application
layer and the presentation layer for PHP applications.
These engines are quite heavily used also (check the source code of most large
open source projects and commercial applications...)
heh heh - you said "load"
Mind the gap
Having browsed only a few ASP.NET howtos but not having had the opportunity (or misery -- since this IS slashdot) to code in it, I'm not too familiar with ASP.NET
OTOH, I am a bit more involved in programming in PHP. I think it's fairly nice and simple enough. Haven't gotten into a lot of the OO stuff but it's still fairly powerful with the simple things I do.
From what I've read, ASP.NET abstracts a LOT of the stuff from the programmer. Forms pretty much take care of themselves, validate on their own, and repopulate themselves for the user to correct. Among other things, this helps isolate code from content.
From experience (which may be very limited), PHP doesn't have this feature. This allows for so much more control over what happens to your forms, but also introduces more code into the mix which could get ugly after a while.
Thus we have control vs. abstraction -- a classic debate. Convenience and rapid development would lean towards abstraction (as anyone who coded VB may argue). Would be nice if PHP had that n00b convenience somewhere while still being great for more advanced coders.
Ultimately, control is probably the choice for anyone who wants to get past the abstraction. Besides, in the long run, you'd probably want to write your own data validation code (or at least implement an open-source version) instead of relying on a (closed-source) language to check for you. That's simply a matter of trust.
For people who think there must be something better to write web-based applications than PHP, I invite you all to take a look at Seaside by Avi Bryant, a web framework available for Squeak and, I think, VisualWorks Smalltalk. It uses continuations to make programming a web application basically the same as coding a desktop application. It features many, many things that PHP cannot do.
For those of you who don't know PHP, just wait a version or two. It already supports VB, C, C++, Javascript and Perl style coding. Version 5 is basically Java. Expect Intercal, Unlambda, and BrainF*** support by version 7 or 8. If you know a Turing-complete language, chances are you'll be able to use it to code PHP by the end of the decade.
WARNING: there is a trojan on your
What advantage does PHP have over Perl?
At first, I rejected PHP because of its (apparent) preference for intermingling presentation and logic. As has been thoroughly discussed in another thread, separating the two is not only possible but recommended. That doesn't give PHP any points though -- it just removes a penalty.
Both languages have a wide range of libraries/modules to choose from (although I think the score here goes to Perl). Their syntax is nearly identical. They both run on lots of different platforms. PHP is pegged as a tool for making web sites, while Perl is a general-purpose scripting language that happens to be useful for web sites too.
So, make a business case for me. I manage a development team (I rose from the ranks so save your MBA jokes for another day) and I want to know why I should consider PHP over Perl.
irb(main):001:0>
I personally use a proprietary templating engine, but if I was to use any of the open-sourced ones, I would first look at what my requirements are.
If you are looking for a full-fledged templating that has all the bells and whissles, I would recommend Smarty because it has a massive amount of feature and seems to be quite endorsed by official PHP developers.
If you are looking for something a little simpler to bring more speed and less overhead to your presentation layer, I do like the approach of the Sigma templating engine (in the links posted above) as it brings only what you really need and does it very quickly.
A test run of our PHP setup on PHP5 RC1 seems to be more responsive and crisp than it was on PHP4.
Riiight. "Crisp". Yeah, that sounds like a very analytical test run you did. Did you also notice PHP5's woody undertones and how it satisfies the spirit without weighing down the heart?
So does PHP5 have proper Unicode support, or are we still supposed to pretend that you can treat UTF8 as ASCII and that it will 'just work'?
You got to be kidding.
PHP has two primary strengths: architecture and standards.
Java is a general purpose language build from the ground up as an OOP. Java is used from embedded systems, mobile phones, desktops, webapps to world class enterprise projects. Java has a sound definition as a language and its virtual machine. Java standards are defined by the JCP with formal methods for approving changes including Apache.
AFAIK PHP is used only in webapps. OOP was added as an afterthought. PHP is a project of the Apache Software Foundation.
Architecturally has native standard access to databases and there are drivers for every db, supports distributed transactions, has message queues, takes advantages of multiprocessors, JIT native compilers in the VM, libraries for every need. Don't know about PHP but for what I know Java has a more advanced architecture.
The majority of java webspace applications were written before css and xhtml were mainstream.
What apps are you talking about? The PHP changelog shows that PHP 4.0 was released in may 2000. The great mayority Java webapps are based on servlet API 2.2 or later which where release on april 2000. Please explain how Java apps are less suportive of css and xhtml than PHP. BTW, how many PHP 3.x webapps are there?
I predict that there will be a need for css and xhtml conversions among the big java web apps and this will be readily delegated to PHP.
If I would have a Java webapp that needs to support css and xhtml it would be ridiculous to rewrite the app in another language, when it could be easily adapted. How would I explain it to my customer? There's nothing in Java or PHP that prevents using css or xhtml or making them automatically supported.
I don't mean that PHP isn't useful, but Java has just a broader scope.
"I think this line is mostly filler"
PHP has a smaller syntactical (is that a word?) footprint. As you said that you manage a development team, this is important. The Perl motto of "There's more than one way to do it" becomes an issue when you've got multiple developers working on the same codebase. You can write and (attempt to) enforce code style rules in your organization, which mitigates this a little bit, but it takes time to write those guidelines, get buy-in, and enforce.
I use perl often, but I consider it a "fire and forget" language. I use it for sysAdmin type work often, when I'm doing something once, and want to write a quick script that nobody (including me) will ever lay eyes on again. For real development, where I'm trying to create a maintainable piece of software, with input from other developers, I stick to PHP.
I used to be a PHP developer, but switched to python-based content management systems due to the elegance and ease of programming in python. However, I was interested to see how PHP had progressed since the last version, and read the article linked by Slashdot.
The main reason I initially dumped PHP was its atrocious error handling. Python and other more elegant languages use exception handling, which is much more elegant than checking return codes and setting error handlers.
I had read earlier than PHP 5 would include exception handling, but wouldn't include the "finally" clause. For programmers that understand and use exceptions, the finally clause is _very_ useful. I try to avoid using C++ simply because it doesn't have a finally clause (and no, the object destruction mechanism is not a good substitute).
So, I became very excited when I read the following:
Note that there is support for "catch all" and for the "finally" clause.
(http://www.php.net/zend-engine-2.php)
However, I couldn't find any examples showing the "finally" clause or the "catch all" clause in use.
So, I went grepping through CVS.
In the changelog for PHP, it is suggested that all exceptions _must_ inherit from a base 'Exception' class, which means that catching and exception of type 'Exception' is a basic "catch all". However, I couldn't find _any_ evidence in CVS that a "finally" clause has been introduced in PHP 5.
Has anyone here found evidence that the "finally" clause exists in PHP 5?
Devin
All the OO features are nice, but what's really missing in PHP are some critical "enteprise" features, like true connection pooling (and no, pconnect doesn't count).
The Raven
I reported a showstopper bug two days ago that crashed Apache 2 hard.
It's been fixed now, but I don't see how they can go and say "Oh, it's really really getting there now" after bugs like that have been discovered so recently.
But PHP's development is odd to say the least. In the Betas alone, entire sections of functionality have been rewritten. From scratch. I mean, shit.
Don't get me wrong, PHP is a great language and PHP5 is a step in the right direction but the development of PHP seems, to me at least, so hell for leather.