There are a lot of complaints about PHP, and even these complaints come from a lot of smart people. When Jeff Atwood wrote another article about PHP, I thought about the good aspects of PHP.
The biggest problem with these complaints is that they come from people who are still using the old version of PHP. They may be unwilling to care, perhaps unwilling to admit that PHP is evolving at a rapid pace, both at the language level and at the community level. It actually evolves faster than any other language or web platform. It's not always the case, but PHP has gone through an amazing process over the past five years.
Before talking about the amazing achievements of the recent PHP community, let's take a look at some interesting numbers: PHP is used by 77.9% of the Web sites known to the Server programming language. WordPress is used by 16.6% of the world's web sites. The highest utilization of the three CMS station system is: The first WordPress share of 54.3%, the second Joomla share of 9.2%, the third Drupal share of 6.8%. All three of these products are written in PHP.
PHP must have done something right, hasn't it?
Now, let me tell you, PHP's stunt is: Despite all these years of change, PHP is still the easiest language to learn for non-technical people, it makes it possible to build dynamic Web sites faster than other technologies, and it also gives people no trouble hosting Web sites. PHP may not be the best design language in the world, but it will allow you to accomplish things (get things do), which is beyond doubt.
PHP language
PHP5.0 (released in 2004) brings a very useful object model ... Wait, I'm talking about something that was released 8 years ago. Fast-forward to the current PHP5.4, the latest version of PHP, brings to you what you've always dreamed of in modern Web languages: Yes, PHP supports namespaces (namespaces); Yes, PHP supports closures (closure); Yes, PHP supports traits.
Although it takes some time, PHP5.4 brings some grammatical sugars that make the overall experience better than ever: Yes, PHP supports defining arrays with []; Yes, PHP supports the newly created object to call the function: (New Foo ())->bar (); Yes, PHP supports arrays to get elements like this: $foo->bar () [1].
PHP even learns from its own mistakes: register_globals and magic_quotes have been completely removed.
PHP has a built-in Web server to facilitate local testing, which can be started at a microsecond speed.
The next challenge: How do we update the tutorials on the web that explain PHP? What is the best technology to support WebSocket in a PHP program?
PHP Eco-System
It's good to have a good language, but it's great to have a good ecosystem. In the past few years the PHP ecosystem has evolved a lot.
Git
For git I don't want to talk too much, git is used everywhere, and PHP quickly embraces git. Almost all PHP class libraries, frameworks, and products are using git, including PHP itself.
Composer
Two years ago, I wanted to get rid of the ugly pear code i hack in Symfony 1 to support Plug-ins. I wanted to replace something that could manage the project, rather than a whole installation like pear, so I tried to find the best algorithm to manage the software dependencies. I've tried almost every possible: from Perl to Ruby, from Debian to Redhat. The result didn't satisfy me, only my own solution happened to work ... Of course it's just my experience to talk about. Then I stumbled upon zypp, and that was it. ZYPP uses Boolean gratification problem solutions to manage dependencies. Thanks to the hard work of Nils Adermann and Jordi Boggiano, PHP now has a good management-dependent tool –composer.
Yes, PHP has a better dependency management tool than any other language.
With the Git,composer, and PHP built-in Web server, it's easier to download/test/install a PHP project.
Want to test symfony (using PHP5.4)?
Copy Code code as follows:
$ Composer.phar Create-project symfony/framework-standard-edition
$ CD Framework-standard-edition
$./app/console Server:run
Want to test Silex?
Copy Code code as follows:
$ Composer.phar Create-project Fabpot/silex-skeleton
$ CD Silex-skeleton
$ php-s localhost:8888-t web/
You don't know composer? You should have known about it.
Browse the main composer warehouse Packagist, which already has more than 1900 packages, and they have been installed millions of times in less than three months.
Next challenge: Built-in composer in the next PHP version?
Cooperation
Community cooperation is the focus of this article, but also I am most proud of the place. We're starting to see better collaboration in PHP projects, even big projects, so big that you can ignore other projects.
Phpbb,drupal,ez Publish,symfony, and many other items (such as Phpdocumentor, PHPUnit, Behat, Zikula, Propel, doctrine, Midgard, and so on) are sharing code. Yes, they are competitors, but they all understand that it is important to cooperate with each other. Composer can promote this kind of cooperation very well.
The next challenge: persuading more projects to join the trend.
Conclusion
Let me repeat that PHP may not be the best programming language and I'm the first to say it, but PHP is by far the best web platform.
PHP is very much better than