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!"
Not quite...
by
Anonymous Coward
·
· Score: 1, Informative
Actually, PHP folks seem to think mixing business and display logic is a bad idea (like the rest of the world):
smarty.php.net
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
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) + (&)
Re:Power Power Power
by
mcrbids
·
· Score: 2, Informative
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.
I just think about how easy it is to create something with PHP. Not necessarily the death throws of Perl. I started with CGI and Perl, and did quite a lot of it many years ago. I've worked with ASP too; I liked the flow of it, but it was too microsoft centric. When I came to doing web programming again, PHP was what was available, and I LIKE IT! Very powerful.
Any language that has a 4000 page Help document that is extremely easy to use and find information, is an excellent programming language.
Re:It is NOT stable
by
LostCluster
·
· Score: 3, Informative
A "release candidate", by definition, is thought to be stable, but they're not quite sure enough to declare it in the stable release yet.
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.
Yep. And if you inline presentation and data in a complicated web app, that's bad design.
Re:Safety?
by
Anonymous Coward
·
· Score: 2, Informative
Well that depends, would you include: private and protected members/methods, abstract classes, class type hints, the "final" keyword, destructors and/or exception handling as safety features?
Since I only really use my own classes, I'm not overly concerned about hiding internal class members/methods, but I'm really looking forward to exceptions (nothing like doing a big block of queries, ALL of which have the same error checking code).
As for type checking, yes, my partner and I (him a Perl hacker and me a former Delphi designer) have expressed a definite desire for at _least_ a strict mode. PHP is hardly the only language with loose types... and considering that you are often dealing with form input, which is text, it's nice to not have to do explicit casts all the time.
Of course when working with databases (at least if you don't just make every field a TEXT or equivalent type), it's nice to have that kind of type checking. In which case it is possible to check those types. See the !== and === operators, as well as a series of is_() functions (such as is_string(), is_integer(), etc.
Personally, I wish they could have come up with a real date/time type... that's one thing I really miss about Delphi...
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..
Type checking maybe more impractical and less useful than many people think.
Bruce Eckel explains this quite well: http://mindview.net/WebLog/log-0051
Uh, mod down, WRONG!
by
Anonymous Coward
·
· Score: 2, Informative
MT runs on Perl, (not even mod_perl at that) not PHP.
If it ran on PHP (or even mod_perl), it probably wouldn't have the scability issues it currently has.
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.
Re:PHP in comparision to others
by
justMichael
·
· Score: 3, Informative
If you put a site together with a little planning and a properly setup cache and then use a template engine that supports output caching you can rival static pages depending on how often the page "needs" to hit the DB.
This really all depends on the sites content, an average ecommerce site probably only needs to hit the database once a day, slash on the other hand could cache the front page for non-logged in users for 5 minutes, which I believe they are doing now with perl.
As usual YMMV.
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...)
running both php 4 and php5
by
ubiquitin
·
· Score: 3, Informative
Apache 2.x MPM is safe with PHP 4.3.x
by
dananderson
·
· Score: 2, Informative
Apache 2.x is safe if you use the MPM (process) model, not the thread model. The problem isn't PHP, but multiple underlying libraries used by PHP. YMMV.
Don't use PHP 5.x yet for production. Wait until it's released (at least), or a few months after the initial release.
Re:Power Power Power
by
Tablizer
·
· Score: 2, Informative
I think the "separate presentation" thing does not work well in practice. One-to-one translations usually don't work, and the frequency of out-right switches to other platforms/UI is not frequent enough to justify the up-front costs IMO.
See the debate at: http://www.c2.com/cgi/wiki?SeparateDomainFrom Prese ntation
Re:Power Power Power
by
oZZoZZ
·
· Score: 2, Informative
Agreed... I wrote a 150k line 'application' for a company's inventory and job control... after a month into the project, I had to scrap the whole project and start again. I ended up using 'module' functions to query databases, another set of 'modules' to format the data as xml, and another set to process the xml data with xslt using sablotron.
The three internal-tiers worked remarkably well, and made changing the application extremely easy. To make changes even easier, all insert functions were selects to postgres stored procs written in pl/pgsql, and all selects were done to views, both of which could be very easily changed without affecting the underlying data structure (or the underlying data structure could be changed without affecting the program).
Re:Time for /. to
by
Anonymous Coward
·
· Score: 3, Informative
You don't want Zend Optimiser (pointless) you want Turck MMCache
turck-mmcache.sf.net
It caches the compiled op-codes. Makes php MUCH faster. Reduced the load average on my machine from about 8 to 0.56
Re:Power Power Power
by
Doyle
·
· Score: 2, Informative
I'm mostly of that opinion as well. The author of bTemplate wrote an essay on using PHP as its own template engine. That said, I actually prefer to use Smarty since I do coding and design for our intranet. I've found it easier to switch hats when I have to switch syntax as well.
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"
Get to know PHP5
by
gabe
·
· Score: 3, Informative
If you're wanting to learn about all the wonderful new features in PHP5, then grab this book. It covers more advanced topics (hence the name Advanced PHP Programming) but it's an absolute must for serious PHP developers. If you're a beginner, learn PHP in general first, then grab that book.
Re:PHP vs. Perl
by
Gerner
·
· Score: 2, Informative
So my background is C, C++, and Java ( 10+ years ) and about three years ago I needed to start writing some web based applications. I tried both Perl and PHP and they both did the job. Eventually PHP won out for most all of my web development because it is so familiar to use for someone with my background. This is PHP's big win, it is easy to be very productive very quickly because the syntax is so familiar for a lot of developers. The available third party libraries and the online documentation alse keep developers productive.
My bet is that anyone who has never used either Perl or PHP will choose PHP, if they've already developed in one of the languages I mentioned above.
Re:Perl and even better?
by
C_Kode
·
· Score: 2, Informative
Most of our company's web applications are written in PHP, but that isn't where php has the heaviest use in our company. I have the CGI version of it installed on all of our Windows servers, and use it as the *shell scripting language* for our Windows boxes. It's like batch files that can use complexed logic, network protocols, database connectivity, and best of all. It's absolute ease of use. It has made alot of my Windows jobs a breeze to automation and manage.
Re:just too bad
by
SnatMandu
·
· Score: 2, Informative
References work well enough. Show me where you've been constrained.
magic_quotes - you're totally right. Teh are the SuX. But it's not hard to work around. You just have some low-level test that checks the mq setting, and then conditionally addslashes() or not. It's not *that* hard. It's just one of those things you figure out when you realize that, for example, you're writing code that you're going to publish.
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...
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.
Re:XML/XSLT for humans?
by
prockcore
·
· Score: 2, Informative
Firstly, it required that PHP be recompiled with the Sablotron module, which would have made the software inaccessible to most of its current user base.
Yeah, that blows. But XSLT is probably the most powerful and quickest templating systems available.
We use XSLT to serve up all of our stories. We wrote an apache module which is passed two IDs, one ID is the story, the other is the xslt. The module fetches the xml from a database, and loads the xslt from disk. Applies the two, and returns the output. (It does a lot more, including fetching index pages and building xml search results, both of which have their own XSLTs to be applied)
We then have a PHP front end which basically calls the apache module and then passes the output to the end user.
It is extremely fast, and it makes it very easy to provide multiple versions of a story (HTML, RSS, PDA, WML, Email, and printer friendly version).
In fact, the database is still the slowest piece of the puzzle.
XSLT takes some time to learn, but it's not that hard, and the results are amazing.
Re:It is NOT stable
by
Anonymous Coward
·
· Score: 1, Informative
Of course it is not stable enough for production use - but it's stable enough for start porting your software for PHP5. There's some signifient (and GREAT) improvements in object model which our company has found very useful. With this RC1 release, we'll start new bleeding edge branch to port our 100 000 lined object oriented software to PHP5.
There's some good changes for example that constructor is always ___constructor(), of course drawback in porting is that you need to change it to all of your classes. But in long term it's good since you don't need to change constructor names every time you change name of class (for some reason).
Small tip for making your constructors PHP5 compatible:
function __constructor($foo) {
$this->oldClassConstructor($foo); }
function oldClassConstructor($foo} {
return $foo; }
This makes constructor PHP5 complitant with same time keeping your old PHP4 constructor working.
PHP5 also has private functions,classes,variables and other nifty stuff:-)
Re:XML/XSLT for humans?
by
trianglecat
·
· Score: 2, Informative
Well... XMLSPY is one choice. The enterprise edition comes with "Sylesheet Designer" (which has since been renamed "stylevision" me thinks) in the last update. It is supposed to be a WYSIWYG editor which includes tags to your xml schema. My experience is with stylesheet designer...its buggy, it takes lots of tweaking, but again its a helluva lot better than doing it by hand.
Actually, PHP folks seem to think mixing business and display logic is a bad idea (like the rest of the world): smarty.php.net
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.
That tenet is still true. If this were not true there wouldn't be some 112 projects on sourceforge with "PHP" and "template".
I personally use PHPLib templates, something I've discussed quite publicly.
Mixing logic and presentation is a no-no for effective software design.
I have no problem with your religion until you decide it's reason to deprive others of the truth.
I just think about how easy it is to create something with PHP. Not necessarily the death throws of Perl. I started with CGI and Perl, and did quite a lot of it many years ago. I've worked with ASP too; I liked the flow of it, but it was too microsoft centric. When I came to doing web programming again, PHP was what was available, and I LIKE IT! Very powerful.
Any language that has a 4000 page Help document that is extremely easy to use and find information, is an excellent programming language.
http://github.com/gbook/nidb
A "release candidate", by definition, is thought to be stable, but they're not quite sure enough to declare it in the stable release yet.
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.
It's in the design.
Yep. And if you inline presentation and data in a complicated web app, that's bad design.
Well that depends, would you include: private and protected members/methods, abstract classes, class type hints, the "final" keyword, destructors and/or exception handling as safety features?
Since I only really use my own classes, I'm not overly concerned about hiding internal class members/methods, but I'm really looking forward to exceptions (nothing like doing a big block of queries, ALL of which have the same error checking code).
As for type checking, yes, my partner and I (him a Perl hacker and me a former Delphi designer) have expressed a definite desire for at _least_ a strict mode. PHP is hardly the only language with loose types... and considering that you are often dealing with form input, which is text, it's nice to not have to do explicit casts all the time.
Of course when working with databases (at least if you don't just make every field a TEXT or equivalent type), it's nice to have that kind of type checking. In which case it is possible to check those types. See the !== and === operators, as well as a series of is_() functions (such as is_string(), is_integer(), etc.
Personally, I wish they could have come up with a real date/time type... that's one thing I really miss about Delphi...
Gregory Wood
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.
Type checking maybe more impractical and less useful than many people think.
Bruce Eckel explains this quite well:
http://mindview.net/WebLog/log-0051
MT runs on Perl, (not even mod_perl at that) not PHP.
If it ran on PHP (or even mod_perl), it probably wouldn't have the scability issues it currently has.
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.
If you put a site together with a little planning and a properly setup cache and then use a template engine that supports output caching you can rival static pages depending on how often the page "needs" to hit the DB.
This really all depends on the sites content, an average ecommerce site probably only needs to hit the database once a day, slash on the other hand could cache the front page for non-logged in users for 5 minutes, which I believe they are doing now with perl.
As usual YMMV.
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...)
Yes, I've run php5 and php4 on the same box for almost a year. There are a handful of howto's for running two modules under apache, for examplea quickl Google gives me: www.schlitt.info/applications/blog/archives/83_How _to_run_PHP4_and_PHP_5_parallel.html
http://tinyurl.com/4ny52
Don't use PHP 5.x yet for production. Wait until it's released (at least), or a few months after the initial release.
I have a webpage on how to build and use PHP with Apache 2.x at http://dan.drydog.com/apache2php.html 4.3.4
I think the "separate presentation" thing does not work well in practice. One-to-one translations usually don't work, and the frequency of out-right switches to other platforms/UI is not frequent enough to justify the up-front costs IMO.
m Prese ntation
See the debate at:
http://www.c2.com/cgi/wiki?SeparateDomainFro
Table-ized A.I.
Agreed... I wrote a 150k line 'application' for a company's inventory and job control... after a month into the project, I had to scrap the whole project and start again. I ended up using 'module' functions to query databases, another set of 'modules' to format the data as xml, and another set to process the xml data with xslt using sablotron. The three internal-tiers worked remarkably well, and made changing the application extremely easy. To make changes even easier, all insert functions were selects to postgres stored procs written in pl/pgsql, and all selects were done to views, both of which could be very easily changed without affecting the underlying data structure (or the underlying data structure could be changed without affecting the program).
You don't want Zend Optimiser (pointless) you want Turck MMCache
turck-mmcache.sf.net
It caches the compiled op-codes. Makes php MUCH faster. Reduced the load average on my machine from about 8 to 0.56
Popularity of programming languages
Doesn't seem to be fading just yet... ;)
I'm mostly of that opinion as well. The author of bTemplate wrote an essay on using PHP as its own template engine. That said, I actually prefer to use Smarty since I do coding and design for our intranet. I've found it easier to switch hats when I have to switch syntax as well.
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"
If you're wanting to learn about all the wonderful new features in PHP5, then grab this book. It covers more advanced topics (hence the name Advanced PHP Programming) but it's an absolute must for serious PHP developers. If you're a beginner, learn PHP in general first, then grab that book.
Gabriel Ricard
http://php.net/mbstring
Gabriel Ricard
So my background is C, C++, and Java ( 10+ years ) and about three years ago I needed to start writing some web based applications. I tried both Perl and PHP and they both did the job. Eventually PHP won out for most all of my web development because it is so familiar to use for someone with my background. This is PHP's big win, it is easy to be very productive very quickly because the syntax is so familiar for a lot of developers. The available third party libraries and the online documentation alse keep developers productive.
My bet is that anyone who has never used either Perl or PHP will choose PHP, if they've already developed in one of the languages I mentioned above.
Most of our company's web applications are written in PHP, but that isn't where php has the heaviest use in our company. I have the CGI version of it installed on all of our Windows servers, and use it as the *shell scripting language* for our Windows boxes. It's like batch files that can use complexed logic, network protocols, database connectivity, and best of all. It's absolute ease of use. It has made alot of my Windows jobs a breeze to automation and manage.
References work well enough. Show me where you've been constrained.
magic_quotes - you're totally right. Teh are the SuX. But it's not hard to work around. You just have some low-level test that checks the mq setting, and then conditionally addslashes() or not. It's not *that* hard. It's just one of those things you figure out when you realize that, for example, you're writing code that you're going to publish.
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...
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.
Firstly, it required that PHP be recompiled with the Sablotron module, which would have made the software inaccessible to most of its current user base.
Yeah, that blows. But XSLT is probably the most powerful and quickest templating systems available.
We use XSLT to serve up all of our stories. We wrote an apache module which is passed two IDs, one ID is the story, the other is the xslt. The module fetches the xml from a database, and loads the xslt from disk. Applies the two, and returns the output. (It does a lot more, including fetching index pages and building xml search results, both of which have their own XSLTs to be applied)
We then have a PHP front end which basically calls the apache module and then passes the output to the end user.
It is extremely fast, and it makes it very easy to provide multiple versions of a story (HTML, RSS, PDA, WML, Email, and printer friendly version).
In fact, the database is still the slowest piece of the puzzle.
XSLT takes some time to learn, but it's not that hard, and the results are amazing.
Of course it is not stable enough for production use - but it's stable enough for start porting your software for PHP5. There's some signifient (and GREAT) improvements in object model which our company has found very useful. With this RC1 release, we'll start new bleeding edge branch to port our 100 000 lined object oriented software to PHP5.
:-)
There's some good changes for example that constructor is always ___constructor(), of course drawback in porting is that you need to change it to all of your classes. But in long term it's good since you don't need to change constructor names every time you change name of class (for some reason).
Small tip for making your constructors PHP5 compatible:
function __constructor($foo) {
$this->oldClassConstructor($foo);
}
function oldClassConstructor($foo} {
return $foo;
}
This makes constructor PHP5 complitant with same time keeping your old PHP4 constructor working.
PHP5 also has private functions,classes,variables and other nifty stuff
http://www.zend.com has an article about changes in object model...
cheers!
Well... XMLSPY is one choice. The enterprise edition comes with "Sylesheet Designer" (which has since been renamed "stylevision" me thinks) in the last update. It is supposed to be a WYSIWYG editor which includes tags to your xml schema. My experience is with stylesheet designer...its buggy, it takes lots of tweaking, but again its a helluva lot better than doing it by hand.