PHP is the first dynamic scripting language I learned and have been using it ever since. Facebook uses it. Can someone explain what it's issues are and any suggest any comparable alternatives? Thanks!
Like many people, many years ago I learned php. It was easy to deploy, and make simple dynamic websites. Many hosting services provided support for it. I was quite happy to use it for these things.
Then in 2008 I interned at Facebook. At the time, there had not yet been any attempts to improve the language by Facebook itself. Using php in an actual codebase - real world software - made me realize just how terrible it was. I vowed to never use it again. I even presented some of the worst aspects of php in my intern presentation to the executive team. Mark was quite intrigued. At the time there were talks of how to deal with many of the problems, but nothing had been figured out by time I left.
Its deficiencies are too numerous to simply list here, so I'll give you a high level summary (which many have also said similar things). Php is a giant hacked language originally not designed for real software and then features added on. It's syntax is the worst of any used language; it's language features are severely lacking; its implementations are contradictory, confusing, and destructive. In short, it is not easy to read, it is easy to shoot yourself in the foot, it is not able to scale both in complexity and performance; and its libraries are a mess.
What many folks forget is that the version of PHP Facebook has in Production (HipHop) is not the same version most have when they deploy PHP. Legacy & inertia has retained PHP at FB but it is far better managed then what others are doing with it today.
I have a list of few points and poor excuses used by folks to justify PHP as language of choice in today's times: http://www.theroadtosiliconvalley.com/technology/php-coding-...
I am sure if Facebook were starting up today they would not choose PHP as their primary language of choice.
I keep reading always the same things from people who simply don't know how to use it properly and feels hurted by a different-than-what-studied-at-school syntax.
A quick dive into any PHP-related topic on HN should yield significant answers. Part of the hatred comes from the fact that the way people know PHP is from 2005, when it was essentially one really long procedural program. It's not so much that people ignore the recent upgrade in tooling/modern language constructs so much as people aren't familiar that they exist.
However, these is still a lot of vitrol for PHP. Because it is so easy to use, many people are able to pick it up without any prior SE experience--these people tend to create poorly-designed, slow-running, and, perhaps worst of all, dangerous (vis a vis security) code.
The other major complaint that exists has to do with inconsistency/insanity in PHP's function signatures/naming/evolution. For example: mysql_escape_string and it's sister, mysql_real_escape_string. Although, anyone working with modern PHP probably will never touch these functions.
What is overlooked is that it has an extensive base of developers, it DOES scale (this is proven), and the language is improving (as well as the tooling (PHPUnit, XHProf, CI tools), frameworks, package management etc). And although Facebook does use it, it's important to note that, AFAIK, PHP only exists as a thin layer in between "display HTML" and "communicating with backend servers which are going to handle the majority of the work, save for presentation-layer type stuff."
There are a few alternatives to PHP, but they each have their warts too. Ruby is hilarious slow, for example.
I'm surprised people aren't quicker to mention the fact that PHP was (and still is!) responsible for many simple SQL injection database dumps/hacks. A simple string termination was all it took. That I felt gave PHP a massively bad rap as they spent versions after that trying to figure out a way to prevent/deter it.
Nowadays with wrappers it's thankfully less of a problem.
Having just come off a Drupal project myself but having looked at the latest PHP additions as well as Laravel though, it seems to me that many languages are converging and borrowing from each other, which I love. Latest PHP is pretty sweet.
[citation needed]. Also, relevant Stack Overflow debate is available. [1] TL;DR: yes, of course Ruby is slower than, say, C, but today's bottleneck isn't hardware, it's developer productivity. (Developer time costs way more than hardware.)
PHP is not a exceptionally bad platform from a technical perspective, it usually gets the job done, is reliable, easy to operate and performant.
But i guess the real reason why so many developers - including me - hate PHP is that plain PHP is pretty boring. It doesn't have opinions on anything and no exciting concepts or language features. Now you can use great frameworks that implement great ideas in PHP, but because PHP has been around for a long time, much of the code out there and still in production is spaghetti code that is no fun to work with and the only option to change that is often a complete rewrite.
This article is written in an "inflammatory" style, but it makes some hard- to- rebut points about PHP. If you're wondering why people hate PHP, like, really wondering, and not just trying to make yourself feel better about the language, try to get past the tone and read the technical content.
(If you're just trying to make yourself feel better about PHP, just remind yourself that Facebook is built in it, as are lots of other credible systems; languages are tools, and while better tools help, skill and discipline are more important).
There are a number of reasons why PHP is so disliked by outside communities including but not limited to MAGZine's points.
1) As mentioned there are a number of language inconsistencies, much more so than comparable languages. This includes naming schemes for functions
2) PHP and most major projects written in it are insecure. Even up-to-date Wordpress installs are vulnerable to attacks.
3) Testing still isn't in vogue. Few projects have any testing and for those that do the testing tools aren't nearly as strong as in other languages
4) The tooling that surrounds the ruby, python, go, javascript languages is much more advanced than what PHP has even now. PHP only really got a decent package manager last year.
5) For a long time most PHP projects were procedural. Real OO was only introduced in PHP 5.
6) There is a lot of bad code written in PHP because it was so accessable.
7) Most examples of PHP projects are CMS' which don't require a ton of experience to build. You meet a lot of people who have spent 10 years in the industry that really have just managed content that don't know how to build something complex and don't have any background in data structures, algorithms etc
8) The PHP community is extremely fractured. There are something on the order of 10+ major PHP frameworks. Zend, Symfony, Codeigniter, Cake, Laravel, Kohana, Yii plus a number of more minor frameworks like Lithium, Silex etc before you get to the CMS' like Joomla, Wordpress and Drupal
1) Agreed.
2) Citation? PHP is extremely popular so it has more insecure code in comparison to Ruby. Also Rails isn't above multiple security vulnerabilities per year so I don't see how Wordpress (which incidentally is an extremely old application) could be.
3) Testing is extremely popular these days. It's 2014, not 1999.
4) Agreed. PHP finally got shut of PEAR and Composer has had an unbelievable impact on PHP.
5) PHP 5 was released 10 years ago. Give it up already about procedural code.
6) Agreed.
7) Not my experience.
8) PHP has a massive community. Ergo, it has a long tail of frameworks. I seem to remember that Ruby has had more than one.
Essentially because it wasn't a well-thought out language, but a hack, it became used widely, but that lack of thoughtfulness shows on larger projects quite a bit. It is a hack that need to become more formalized with time, but it hasn't quite done that. Whenever I still see "needle" and "haystack" in documentation I think "Wait what is this? Oh right..."
>Facebook uses it
Not really, I mean Facebook doesn't use the PHP that a common person uses.They've made so many changes and their codebase is so huge. Facebook also uses the D programming language, HipHop, and probably more tools than I'll ever know. Wasn't chat at Facebook first written in Erlang?
Furthermore, the only reason Facebook stuck with php and made massive changes to make it somewhat usable is because of its huge legacy codebase. They would have much rather be working in a different language these days.
For one, it's no secret that PHP was an amateur undertaking that inadvertently ended up powering >80% of the web.
It started off as a bunch of helper functions that were meant for Rasmus Lerdorf's personal use. He has frequently acknowledged that he was never particularly skilled and that PHP was never meant to be used on such a large scale. Among the countless WTF moments you would expect from a personal project, PHP once used strlen() as a hashing function. [1]
Thus, PHP ended up having a very inconsistent design and an awful typing system. It ended up becoming quite baroque, it has never had a formal specification and it has no coherent idea of what it wants to be. This is exemplified by PHP's relatively recent appropriation of Java idioms in an attempt to bring vague Nygaard OOP.
Third, it's fundamentally a templating language and it doesn't encourage any cohesive design patterns or practice. Most PHP sites don't even use frameworks, but rather go with the Mozart (or rather, spaghetti) style of copy-paste programming. There is no clear separation of concerns.
Fourth, the PHP community has always been dominated by amateurs. I can't really direct you to any objective statistics, but in general PHP has a disproportionately high amount of leechers and newbies, largely because it has been so deeply ingrained into the public consciousness as the de facto language of the web, without knowing of the better designed general-purpose alternatives.
Fifth, some concrete examples of PHP's horrific internals. [2] [3] [4]
Alternatives? Anything, really. Python, Ruby, Perl, Common Lisp, Haskell... whatever floats your boat. A minimal web framework is a trivial application to write. That's why there's so fucking many of the goddamned things.
PHP does what it does relatively well, but it's a quirky muddle of a language and its design is very tightly bound to a CGI-style model of web development.
Anything can be hacked around, of course, as Facebook has proven. But you could write Facebook in Bash or DOS Batch Language if you were willing to. But newer frameworks and languages that were designed with modern web development in mind are more to a lot of people's liking than PHP's style.
Really, the best way for you to answer your question is to dig in and learn how to develop a webapp using Ruby or Node.js or Python and the amazing frameworks that are built on those languages. Dig in for a couple of years and then on the other side you'll understand better. You may still prefer PHP, but even if you do, I'll bet the PHP code you write will be better for having learned how the "other guys" do things.
IMHO, PHP is hated and misconsidered because: Since a few years ago, it was mainly used by amateurs. The truth is that PHP, right now, is a very appealing and competing language. I know several companies that power their services with PHP and it just makes wonders.
Of course: you need to know what you are doing. But the language itself is capable of doing almost everything, without drawbacks.
I think that it is great that "amateurs" have a usable tool. I did have a grudge against PHP, derived from having maintained a system written in that fashion. Do I really care one way or another? No.
I like to equate the technical community with the skiing community. The barriers to entry are tough. It takes a lot of practice to become good skier, and many that do become expert skiers instantly elevate themselves above the rest with routes, equipment, and other types of "I'm more technical than you."
So, back to hate for PHP.
The C++ and Clojure and Erlang crowd are the double black diamond skiers, and they are the first to throw hate at the green and blue skiing crowd - because, well, they've mastered everything else and since they mastered it, well, they are just better than you.
Meanwhile, you've got the PHP type skiers who are cruising the groomers, enjoying the sun and living life - pinching themselves because they are just getting the task done. They occasionally hit a black or two, and even hit the moguls to refine their turns and technique, but they are there to get shit done - which means to ski and have fun.
Then you've got the Perl and COBOL guys who just ski around the mountain and complain about all of the above, since they've been skiing for 40+ years.
Disclaimer: I am an avid skier and maintain a number of successful Web properties based on PHP. And I love the groomers...
$foo = [];
$foo[$userSuppliedString] = 'foo';
foreach(array_keys($foo) as $userSuppliedString) {
if (! is_string($userSuppliedString)) {
die("I understand all the reasons for this behaviour, but it violates the principle of least astonishment");
}
}
Supply a string. Works fine? Try running with a string that looks numeric.
I use PHP every day, it's a great language for many things including teaching programming. Every language has its quirks and i don't really think PHP's quirks are worse than others.
"The Tao gave birth to machine language. Machine language gave birth to the assembler. The assembler gave birth to the compiler. Now there are ten thousand languages. Each language has its purpose, however humble. Each language expresses the Yin and Yang of software. Each language has its place within the Tao - but do not program in COBOL if you can avoid it."
PHP is AWESOME! Because there are so many examples of how to do everything. If you are building a web app you need HTML anyway , and since PHP is like 75% knowing HTML you are a long ways to knowing how to do things. PHP is fast enough for 90% of websites. LAMP is a commodity you can get any hosting provider to set you up in seconds.
PHP is SUCKY! Because it is way to slow for 10% of websites. 90% of coders pieced together their solutions from a mish-mash of code examples they found on the web. HTML is just strewn through out because most people do their PHP inline with the HTML rather than populating variables to output all at once. LAMP has the word Apache, and MySQL in it and that means you inherit some badness that is being sold as a commodity (yeah you can run on a non-lamp but very few who do PHP do, and so you may not be compatible if you stray from LAMP which means you are writing in a non-standard way)
Since everyone concentrates on the development side, let me just leave a note from actually hosting php:
A standard, no crazy stuff, database-backed blog+login site made in Symfony consumes ~60MB of memory. Then discards it and starts again. On each request. Even if the bytecode itself is cached, it has to create/register all the classes and global objects it uses every single time.
I think people should find that at least weird and probably scary. Other languages, which separate continuously running application servers from the page serving, do not do that.
If you tell a room full of Java and C++ developers with no experience to PHP, that on every request, everything gets loaded, and at the end of the request, everything (and I mean everything) gets torn down, you'll get a bunch of blank stares.
However, the web, in its nature, is stateless. So, having a language where nothing persists across requests (except that which you store/retreive by using cookies/session data) is suited to the web. Also, not having to worry about memory management or thread-spawning helped to make PHP the simple, accessible language that it is. No memory leaks!* ;-)
In loadtesting, I've found that PHP is almost always CPU bound. Yeah, you might be loading and unloading 60MB of memory each time, but a) caching (send those 304s!) and b) it's not like your memory is going to 'go bad' from loading/unloading Symfony.
That said, there might be something to keeping Symfony loaded in memory. In my own tests, loading the classmap is one of the longest-running tasks in simpler PHP applications.
PHP is the ghetto. It might be fun or necessary when you're young and can't afford better. But, eventually people who are able, move somewhere they aren't being mentally stabbed in the face every time they pop down to the corner store. This, of course, reinforces the ghetto. As the people who can't leave are the dregs.
Nothing is as black and white as a couple sentences makes it sound. But, that is the place PHP has (deserved or no) in the programming world.
[+] [-] natmaster|12 years ago|reply
Like many people, many years ago I learned php. It was easy to deploy, and make simple dynamic websites. Many hosting services provided support for it. I was quite happy to use it for these things.
Then in 2008 I interned at Facebook. At the time, there had not yet been any attempts to improve the language by Facebook itself. Using php in an actual codebase - real world software - made me realize just how terrible it was. I vowed to never use it again. I even presented some of the worst aspects of php in my intern presentation to the executive team. Mark was quite intrigued. At the time there were talks of how to deal with many of the problems, but nothing had been figured out by time I left.
Its deficiencies are too numerous to simply list here, so I'll give you a high level summary (which many have also said similar things). Php is a giant hacked language originally not designed for real software and then features added on. It's syntax is the worst of any used language; it's language features are severely lacking; its implementations are contradictory, confusing, and destructive. In short, it is not easy to read, it is easy to shoot yourself in the foot, it is not able to scale both in complexity and performance; and its libraries are a mess.
[+] [-] semerda|12 years ago|reply
What many folks forget is that the version of PHP Facebook has in Production (HipHop) is not the same version most have when they deploy PHP. Legacy & inertia has retained PHP at FB but it is far better managed then what others are doing with it today.
I have a list of few points and poor excuses used by folks to justify PHP as language of choice in today's times: http://www.theroadtosiliconvalley.com/technology/php-coding-... I am sure if Facebook were starting up today they would not choose PHP as their primary language of choice.
[+] [-] jnardiello|12 years ago|reply
[+] [-] pan69|12 years ago|reply
Then just list a few of them. Your comment seems highly subjective and opinionated without any concrete examples.
[+] [-] MAGZine|12 years ago|reply
However, these is still a lot of vitrol for PHP. Because it is so easy to use, many people are able to pick it up without any prior SE experience--these people tend to create poorly-designed, slow-running, and, perhaps worst of all, dangerous (vis a vis security) code.
The other major complaint that exists has to do with inconsistency/insanity in PHP's function signatures/naming/evolution. For example: mysql_escape_string and it's sister, mysql_real_escape_string. Although, anyone working with modern PHP probably will never touch these functions.
What is overlooked is that it has an extensive base of developers, it DOES scale (this is proven), and the language is improving (as well as the tooling (PHPUnit, XHProf, CI tools), frameworks, package management etc). And although Facebook does use it, it's important to note that, AFAIK, PHP only exists as a thin layer in between "display HTML" and "communicating with backend servers which are going to handle the majority of the work, save for presentation-layer type stuff."
There are a few alternatives to PHP, but they each have their warts too. Ruby is hilarious slow, for example.
[+] [-] Volscio|12 years ago|reply
Nowadays with wrappers it's thankfully less of a problem.
Having just come off a Drupal project myself but having looked at the latest PHP additions as well as Laravel though, it seems to me that many languages are converging and borrowing from each other, which I love. Latest PHP is pretty sweet.
[+] [-] nthj|12 years ago|reply
[citation needed]. Also, relevant Stack Overflow debate is available. [1] TL;DR: yes, of course Ruby is slower than, say, C, but today's bottleneck isn't hardware, it's developer productivity. (Developer time costs way more than hardware.)
[1] https://stackoverflow.com/questions/2529852/why-do-people-sa...
[+] [-] mef|12 years ago|reply
[+] [-] drjake|12 years ago|reply
[+] [-] moreentropy|12 years ago|reply
PHP is not a exceptionally bad platform from a technical perspective, it usually gets the job done, is reliable, easy to operate and performant. But i guess the real reason why so many developers - including me - hate PHP is that plain PHP is pretty boring. It doesn't have opinions on anything and no exciting concepts or language features. Now you can use great frameworks that implement great ideas in PHP, but because PHP has been around for a long time, much of the code out there and still in production is spaghetti code that is no fun to work with and the only option to change that is often a complete rewrite.
[+] [-] tptacek|12 years ago|reply
(If you're just trying to make yourself feel better about PHP, just remind yourself that Facebook is built in it, as are lots of other credible systems; languages are tools, and while better tools help, skill and discipline are more important).
[+] [-] feydaykyn|12 years ago|reply
[+] [-] jnardiello|12 years ago|reply
[+] [-] twunde|12 years ago|reply
1) As mentioned there are a number of language inconsistencies, much more so than comparable languages. This includes naming schemes for functions
2) PHP and most major projects written in it are insecure. Even up-to-date Wordpress installs are vulnerable to attacks.
3) Testing still isn't in vogue. Few projects have any testing and for those that do the testing tools aren't nearly as strong as in other languages
4) The tooling that surrounds the ruby, python, go, javascript languages is much more advanced than what PHP has even now. PHP only really got a decent package manager last year.
5) For a long time most PHP projects were procedural. Real OO was only introduced in PHP 5.
6) There is a lot of bad code written in PHP because it was so accessable.
7) Most examples of PHP projects are CMS' which don't require a ton of experience to build. You meet a lot of people who have spent 10 years in the industry that really have just managed content that don't know how to build something complex and don't have any background in data structures, algorithms etc
8) The PHP community is extremely fractured. There are something on the order of 10+ major PHP frameworks. Zend, Symfony, Codeigniter, Cake, Laravel, Kohana, Yii plus a number of more minor frameworks like Lithium, Silex etc before you get to the CMS' like Joomla, Wordpress and Drupal
[+] [-] padraicb|12 years ago|reply
[+] [-] crazytony|12 years ago|reply
[+] [-] 27182818284|12 years ago|reply
>Facebook uses it
Not really, I mean Facebook doesn't use the PHP that a common person uses.They've made so many changes and their codebase is so huge. Facebook also uses the D programming language, HipHop, and probably more tools than I'll ever know. Wasn't chat at Facebook first written in Erlang?
[+] [-] natmaster|12 years ago|reply
[+] [-] wcummings|12 years ago|reply
[+] [-] vezzy-fnord|12 years ago|reply
For one, it's no secret that PHP was an amateur undertaking that inadvertently ended up powering >80% of the web.
It started off as a bunch of helper functions that were meant for Rasmus Lerdorf's personal use. He has frequently acknowledged that he was never particularly skilled and that PHP was never meant to be used on such a large scale. Among the countless WTF moments you would expect from a personal project, PHP once used strlen() as a hashing function. [1]
Thus, PHP ended up having a very inconsistent design and an awful typing system. It ended up becoming quite baroque, it has never had a formal specification and it has no coherent idea of what it wants to be. This is exemplified by PHP's relatively recent appropriation of Java idioms in an attempt to bring vague Nygaard OOP.
Third, it's fundamentally a templating language and it doesn't encourage any cohesive design patterns or practice. Most PHP sites don't even use frameworks, but rather go with the Mozart (or rather, spaghetti) style of copy-paste programming. There is no clear separation of concerns.
Fourth, the PHP community has always been dominated by amateurs. I can't really direct you to any objective statistics, but in general PHP has a disproportionately high amount of leechers and newbies, largely because it has been so deeply ingrained into the public consciousness as the de facto language of the web, without knowing of the better designed general-purpose alternatives.
Fifth, some concrete examples of PHP's horrific internals. [2] [3] [4]
Alternatives? Anything, really. Python, Ruby, Perl, Common Lisp, Haskell... whatever floats your boat. A minimal web framework is a trivial application to write. That's why there's so fucking many of the goddamned things.
[1] http://news.php.net/php.internals/70691
[2] http://www.phpwtf.org/
[3] http://www.phpsadness.com/
[4] http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de... (the famous article)
[+] [-] paulgb|12 years ago|reply
https://www.dropbox.com/s/dgymauqggtyurvp/phpeq.png
[+] [-] skywhopper|12 years ago|reply
Anything can be hacked around, of course, as Facebook has proven. But you could write Facebook in Bash or DOS Batch Language if you were willing to. But newer frameworks and languages that were designed with modern web development in mind are more to a lot of people's liking than PHP's style.
Really, the best way for you to answer your question is to dig in and learn how to develop a webapp using Ruby or Node.js or Python and the amazing frameworks that are built on those languages. Dig in for a couple of years and then on the other side you'll understand better. You may still prefer PHP, but even if you do, I'll bet the PHP code you write will be better for having learned how the "other guys" do things.
[+] [-] jnardiello|12 years ago|reply
Of course: you need to know what you are doing. But the language itself is capable of doing almost everything, without drawbacks.
Lot of people make clueless claims about how PHP is worst than (place-latest-cool-framework/language-here). This is far from being true, read this: http://philsturgeon.co.uk/blog/2013/11/benchmarking-codswall...
So, PHP is hated in the devs world because it gave access to "amateurs" to the world of crafting software. Which is ridiculous.
[+] [-] cafard|12 years ago|reply
[+] [-] blantonl|12 years ago|reply
I like to equate the technical community with the skiing community. The barriers to entry are tough. It takes a lot of practice to become good skier, and many that do become expert skiers instantly elevate themselves above the rest with routes, equipment, and other types of "I'm more technical than you."
So, back to hate for PHP.
The C++ and Clojure and Erlang crowd are the double black diamond skiers, and they are the first to throw hate at the green and blue skiing crowd - because, well, they've mastered everything else and since they mastered it, well, they are just better than you.
Meanwhile, you've got the PHP type skiers who are cruising the groomers, enjoying the sun and living life - pinching themselves because they are just getting the task done. They occasionally hit a black or two, and even hit the moguls to refine their turns and technique, but they are there to get shit done - which means to ski and have fun.
Then you've got the Perl and COBOL guys who just ski around the mountain and complain about all of the above, since they've been skiing for 40+ years.
Disclaimer: I am an avid skier and maintain a number of successful Web properties based on PHP. And I love the groomers...
[+] [-] lawl|12 years ago|reply
PHP a fractal of bad design: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de...
[+] [-] unknown|12 years ago|reply
[deleted]
[+] [-] mappu|12 years ago|reply
I use PHP every day, it's a great language for many things including teaching programming. Every language has its quirks and i don't really think PHP's quirks are worse than others.
"The Tao gave birth to machine language. Machine language gave birth to the assembler. The assembler gave birth to the compiler. Now there are ten thousand languages. Each language has its purpose, however humble. Each language expresses the Yin and Yang of software. Each language has its place within the Tao - but do not program in COBOL if you can avoid it."
[+] [-] drakaal|12 years ago|reply
PHP is SUCKY! Because it is way to slow for 10% of websites. 90% of coders pieced together their solutions from a mish-mash of code examples they found on the web. HTML is just strewn through out because most people do their PHP inline with the HTML rather than populating variables to output all at once. LAMP has the word Apache, and MySQL in it and that means you inherit some badness that is being sold as a commodity (yeah you can run on a non-lamp but very few who do PHP do, and so you may not be compatible if you stray from LAMP which means you are writing in a non-standard way)
[+] [-] neduma|12 years ago|reply
[+] [-] krapp|12 years ago|reply
[+] [-] unknown|12 years ago|reply
[deleted]
[+] [-] viraptor|12 years ago|reply
A standard, no crazy stuff, database-backed blog+login site made in Symfony consumes ~60MB of memory. Then discards it and starts again. On each request. Even if the bytecode itself is cached, it has to create/register all the classes and global objects it uses every single time.
I think people should find that at least weird and probably scary. Other languages, which separate continuously running application servers from the page serving, do not do that.
[+] [-] MAGZine|12 years ago|reply
If you tell a room full of Java and C++ developers with no experience to PHP, that on every request, everything gets loaded, and at the end of the request, everything (and I mean everything) gets torn down, you'll get a bunch of blank stares.
However, the web, in its nature, is stateless. So, having a language where nothing persists across requests (except that which you store/retreive by using cookies/session data) is suited to the web. Also, not having to worry about memory management or thread-spawning helped to make PHP the simple, accessible language that it is. No memory leaks!* ;-)
In loadtesting, I've found that PHP is almost always CPU bound. Yeah, you might be loading and unloading 60MB of memory each time, but a) caching (send those 304s!) and b) it's not like your memory is going to 'go bad' from loading/unloading Symfony.
That said, there might be something to keeping Symfony loaded in memory. In my own tests, loading the classmap is one of the longest-running tasks in simpler PHP applications.
[+] [-] njharman|12 years ago|reply
PHP is the ghetto. It might be fun or necessary when you're young and can't afford better. But, eventually people who are able, move somewhere they aren't being mentally stabbed in the face every time they pop down to the corner store. This, of course, reinforces the ghetto. As the people who can't leave are the dregs.
Nothing is as black and white as a couple sentences makes it sound. But, that is the place PHP has (deserved or no) in the programming world.
[+] [-] kazza|12 years ago|reply
[+] [-] cnlwsu|12 years ago|reply
[+] [-] artificialidiot|12 years ago|reply