293 points · by mrsaint · 12y ago · 139 comments
We still do new projects in PHP and we couldn't be happier.
Edit: This comment comes off as me making fun of PHP, when I simply meant to say that tools can make something effective but what underlies an effective work environment can still be crap. I don't think PHP is "crap," but at a certain level of complexity its easier to get the "average developer" to be effective using another set of tools.
I concur, especially when frameworks like Symfony exist. Reading all this smack talk about PHP on HN is so alien considering how thriving the PHP community actually is.
Many have been where you are now, and then moved on to other languages to never ever look back. From what I've seen, the reverse is much less common.
I don't actually think that faults in a language matter that much if the people using it are competent. Both Javascript and Perl come close to PHP in terms of negative traits, yet a lot of good software was written with both. The same can be said about PHP, the only difference is that people on HN have very little idea about what contemporary PHP (language and software) looks like.
I really doubt that. In my experience there haven't been a single time when someone attacking PHP actually knew something about it that wasn't outdated by at least 5 years.
It's funny how difficult it is for people like you to grasp that the language and its ecosystem evolves every day, much faster than other languages. Just look at what you just said. How can someone have been where I am right now? They used a time machine? Or you are assuming that the language stopped evolving at some point, or never evolved at all in the first place?
Other PHP frameworks lack some or most of these features: some are either very opinionated and rigid (Yii, Cake) huge and sparsely documented (Zend 2) or just old and approaching abandonment (Codeigniter, Kohana).
How do you generate 211 pages per second on Wordpress to begin with? My server does page generation for my own custom-built blog in ~15ms, but takes a whopping three seconds for a single Wordpress page. I know it's somewhat offtopic and it's about the relative results, but what hardware is this?
Because it hit some sweet spot that WP blew over for your host specs? Either memory, number of queries, etc?
You really can't judge it based on that hardware. Of course it runs slower then your "custom" blog... it is probably orders of magnitude more complex.
Also you haven't mentioned what platform you are using. I don't know if those netbooks run linux or windows, but if you are trying to host this on a desktop version of windows with something like Xampp it is really incomparable as well.
This makes PHP much, much faster. The only time the files are recompiled are if you restart your webserver, or if you modify the .php files.
I'm not talking about static html generation, that's another thing all together.
But great work on the PHP engine!
According to https://wiki.php.net/phpng, they benchmarked against Wordpress 3.6 (the current version is 3.9). I couldn't find anything about the Drupal benchmark, but it could be a simple "Hello world" for all we know.
Drupal's big two issues are bootstrapping drupal, because all those module hooks stack up quick, and the sometimes large amount of queries run to generate a page. Drupal 8 has gotten better about not loading half of the world when a blog post is loaded, but 7 is just a wall of functions.
I really don't understand people's aversion to database tables. I have a join, the world is ending! Pay attention to your indexes and 9 times out of 10 everything will be fine. For that 1 other time, there's Varnish.
As far as Wordpress, in my experience the number of db queries is really a bigger problem than the PHP processing. A factory-default install with no plugins runs 30 queries on every home page load. With a fancy theme and a few plugins it can be over 100 queries per page! A caching plugin is pretty much essential for any Wordpress site.
Most Wordpress sites use a caching plugin like WP Super Cache or Varnish-type setup if they get decent traffic though.
In my own benchmarks i've noticed all that class loading and instantiation slows things way down, even with an opcache. I find that a namespaced procedural / functional architecture performs much better, but no PHP framework works that way.
Also, CI out performs Symfony in the web framework benchmarks: http://www.techempower.com/benchmarks/. I certainly would never equate Symfony to "real speed".
The linked email in turn links to the PHP NG page (https://wiki.php.net/phpng) on which the version number mentioned is 5.7.0-dev
Wordpress 3.6 – 20.0% gain (253 vs 211 req/sec)
I have a few enterprise sites that I am constantly looking for ways to optimize for speed: DNS, CDNs etc. This looks like an easy win.
They could name it PHP 7 to avoid further confusion.
In addition, skipping a version number also creates confusion. If they were going to go this route, they should have done it a long time ago (around 2010-2011).
http://www.slideshare.net/andreizm/the-good-the-bad-and-the-...
In the internals all of the zend_hash apis have been updated so it may have an effect on some extensions, though the core extensions can all be updated.
"we changed the basement trying to keep most of the building unchanged."
The "most" part made me wonder what obscure part of userland it would be.
Additionally there is also a way to sort out possible bugs in language specification, as differences across implementations are sorted out.
>>> an throw nearly unlimited money and engineering hours at the problem
They can, but they won't. Because it already works for them, so the amount of resources they are willing to commit to something that no longer gives any upside to them will be limited.
>>> Seems like a losing battle, but perhaps I am wrong.
There's no battle and this is not a zero sum game. HHVM will have its market and standard PHP engine will have its market.