PHP is much better than you think

Rants about PHP are everywhere, and they even come from smart guys.When Jeff Atwood wrote yet another rant about PHP, it made me think about thegood parts of PHP.web

對PHP的抱怨處處都有,他們有時甚至來自於一些聰明的人。當Jeff Atwood寫下另類對PHP的抱怨的時候,它讓我想起了PHP好的方面。express

 

The biggest problem of these rants is that they come from peoplestuck in the old days of PHP. They either don't care or they don't want toadmit that PHP actually evolves at a very fast pace, both at the language levelbut also at the community level. In fact, it evolves much faster than any otherlanguage or web platform. It has not always been the case, but the last 5 yearshave been an amazing journey for PHP.編程

這些抱怨的最大問題在於他們的記憶仍然停留在對PHP過去的回憶上。他們既不關心也不想認可,實際上PHP發展的速度很是快,無論是在語言水平上仍是在社區建設上都是如此。事實上,它比任何其餘的語言或者Web平臺的發展都要快。雖然不一直是這樣,但過去的5年對於PHP來講是一個輝煌的5年數組

 

Before talking about the amazing things the PHP community hasachieved recently, let's have a look at some interesting numbers: PHP is usedby 77.9% of all the websites whose server-side programming language is known.WordPress is used by 16.6% of all the websites in the world. If you have a lookat the top three CMSes, for the websites that use a monitored contentmanagement system: Wordpress is first with 54.3%, Joomla is second with 9.2%,and Drupal is third with 6.8%. Three products written in PHP.服務器

在開始談論PHP社區最近取得的成就以前,讓咱們看一些有趣的數據:在已知的服務器端編程語言編寫的網站的網站中,77.9%用到了PHP。在全世界全部的網站中,16.6%是使用了WordPress(PHP語言組成的框架)。看一下排名前三的CMSes----使用了監視的內容管理系統的網站:Wordpress以54.3%的使有率排名第一,Joomla以9.2%的使用率排名第二,Drupal以6.8%的使用率排名第三。這三個產品都是用PHP來編寫的。app

 

Now, let me tell you a secret, the PHP "tour de force":Despite the changes over the years, PHP is still the easiest language to learnfor non-technical people: it allows anyone to create dynamic websites fasterthan with any other technologies, it allows anyone to host websites cheaply andwithout any hassles. PHP is probably not the best designed language in theworld, but it lets you get things done, and you can't argue with that.框架

 如今,讓我告訴你一個祕密,PHP的」絕技」:儘管這些年來一直在變化,但對於非計算機專業的人來講,PHP仍然是最容易學習的一門語言:它容許任何人建立動態的網站,而且建立的速度比任何其餘的技術都要快,它容許任何人廉價的建立網站,使用網站並且沒有任何麻煩。PHP可能不是世界上最好的設計語言,但它可讓你把事情完成,而你不能反駁這一點。編程語言

 

PHP, the Language (PHP這門語言)ide

PHP 5.0 (released in 2004) brought us a very solid object model...wait a minute, I'm talking about something released almost 8 years ago. Fastforward now. The latest PHP release, PHP 5.4, comes with all the bells andwhistles you might dream of in a modern web language: yes, PHP supportsnamespaces; yes, PHP supports closures; yes, PHP supports traits.學習

     PHP5.0(在2004年發佈)給咱們帶來一個很是堅實的對象模型。等一下,我一直在討論一些8年前就有的事情了。時間過得很快,最新發布的PHP版本是PHP5.4,它配備了全部的鐘聲和口哨聲,這可能就是你作夢想的一種現代Web語言。似的,PHp支持命名空間;是的,PHP支持包;是的,PHP支持特性。

 

It took some time, but PHP 5.4 also comes with some nice syntacticsugar that makes the whole experience better than ever: yes, PHP supports [] todefine arrays; yes, PHP supports calling a method on a newly created object((new Foo())->bar()); yes, PHP supports getting an array item from anyexpression ($foo->bar()[1]).

它須要一些時間,但PHP5.4也帶來了一些好的語法,這使得全部的體驗比之前更好了。是的,PHP支持[ ]來定義數組;是的,PHP支持在建立一個新的對象的時候調用一個方法((new Foo())->bar());是的,PHP支持從一個表達式中獲取一個數組。

 

PHP has even learned from its mistakes: register_globals andmagic_quotes are definitely gone.

PHP已經吸收了過去的教訓:register_globals和magic_quotes這種定義已經被廢棄了。

 

Last, but not the least, PHP even comes with a built-in web serverthat eases local testing... and it starts in a matter of micro-seconds.

最後,但並不是最不重要是,PHP甚至還帶有一個內置的Web服務器,使能在本地測試。它的啓動也就是幾微秒的事情。

 

Next challenges: How do we "upgrade" all the old tutorialstalking about PHP on the web? What is the best way to support the WebSockettechnology in a PHP application?

     下一個挑戰:咱們如何在Web上來升級全部關於PHP的舊教程?在一個PHP應用程序支持WebSocket技術最好的方法是什麼?

 

PHP, the Ecosystem(PHP的生態系統)

Having a good language is great, but having a great ecosystem iseven better. And the PHP ecosystem has evolved a lot in the last few years.

    具備良好的語言是偉大的,但有一個很大的生態系統則是更好的。PHP的生態系統在過去的幾年裏發展了不少。

相關文章
相關標籤/搜索